Ranndom
Ranndom

Reputation: 128

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

Upvotes: 3

Views: 2689

Answers (1)

Martinedo
Martinedo

Reputation: 366

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.

Upvotes: 5

Related Questions