Trouble centering a button

In my layout page I do have several embedded grids that allow proper dispostion ogf the elements.
But sometimes the elements are not where they should be.
I have simplified to the maximum one page to illustrate my problem:
test grid.hrp (390.1 KB)

Could someone help to understand why the button, which shows centered in the UI but as soon as I run it the button is not centered anymore.

Thanks

Your button is not the problem… Your background image is and its throwing things around. Your background image is setup to span 3 but, there is only one column defined in that grid. Change the 3 to a 1 and you’ll be all good.

image

You can also set the background in the “ContentPage”

Thanks for your quick return.
I must admit that I tried to duplicate my issue with a slightly different layout.
So I took my file and removed anything that is unrelated to the issue and in addition I incorporated the background as suggested in the page properties and as you can see in this example I still have the issue without the span over multiple columns:
test grid2.hrp (390.5 KB)
As you can see I have similar issue with the slider and the label.

Thanks,

Daniel

It’s your Slider that is messing up your layout. It is referencing a column number that doesn’t exist. That control’s parent Grid only has 1 column, but your Slider has a Grid.Column of 1. Those are zero based indexes. That control should have a Grid.Column of 0.
test grid2 - fixed.hrp (390.5 KB)

1 Like

:ok_hand: Got it. Grids are wonderful to design a layout that would fit multiple devices/Os, but adding them afterwards or moving items around can mess up the colum and row settings. I had a couple more in the final design but thanks to your guidance I fixed them all and the result is perfect.
Thanks for the great work you are doing continuously!

3 Likes