Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin forms Flex Layout Center Items

I have a Flex Layout located in a StackLayout in my contextmenu. In the Screenshot all below the black line(the white area) is the Flex Layout control.

The 9 Frames inside there are my Items which have a fixed size, but the ammount of them is variable. As its obvious to see the Rows itself aren't centered inside the control, but exactly this is what I want to achieve.

I tried a lot with the Properties, but could not get the Items centered. (Also a test with a 3 Column Grid to shrink the width of the Flex layout didn't work)

Someone here has some ideas what else I could try to achieve the desired result?

Current State

like image 831
Ranndom Avatar asked Jun 29 '26 04:06

Ranndom


1 Answers

JustifyContent="SpaceAround" will do the trick

For more Flex Layout options and element placing, have a look at this site. They explain it with CSS, but the same properties are used in Xamarins FlexLayout too.

like image 137
Martinedo Avatar answered Jun 30 '26 19:06

Martinedo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!