Horizontal Adjustment

Hi,
I have a HorizontalArrangement with Width=FillParent and AlignHorizontal=Center. It contains a Button component with no Text and but an Image. The width of the image is smaller than the screen size.
I colored the HorizontalArrangement and set the AlignHorizontal to left. Now there is a colored rectangle on the right side. Screenshot: https://ullisroboterseite.de/_forDownload/s1.jpg.

Now back to AlignHorizontal=Center: The image extends beyond the right edge: https://ullisroboterseite.de/_forDownload/s2.jpg. It's getting worse if you set AlignHorizontal=right.

Inside the designer window all seems to be ok: https://ullisroboterseite.de/_forDownload/s3.png

A project that shows the problem: https://ullisroboterseite.de/_forDownload/test.aia
and the compiled app: https://ullisroboterseite.de/_forDownload/test.apk

I looked at older versions of my app. There alignment seems to be correct.

My device is a Xiaomi Redmi 5 Plus with Android 8.1.

Regards Ulli

1 Like

Displays centred just fine on my emulator (Google Pixel 3 Android 10) and settings look OK in your test.aia. Could be an issue with your phone.

Try 100% width instead of Fill Parent for the HA ? If that doesn't work also try setting percentage sizing for the button.

Try using responsive sizing

On Screen1 properties

I rebooted my PC and my device. Than with the first test everything seemed to work properly. But after a few clicks (or seconds?) the problem appeared again.

I tried the hint to use 100% instead of FillParent. This solved the problem.

Screen1.Sizing = responsive solves the problem too.

Fixed sizing is a old method of scaling and might have unpredictable issues when showing components..

Hi Ulli, if I set it (→ Fill parent) in the blocks it works also with SizingFixed:

grafik

Tested on Galaxy Note8 (Android 9) and Pixel 2XL (Android 11).