Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Percentage option for rows or columns in Grids?

nousgoalsnousgoals AUMember, University

Gridlength.Auto makes sense: it will lay out the row or column automatically in the available space.
new GridLength(100, GridUnitType.Absolute) makes sense: you assign a certain number of pixels, in this case 100, for that row or column.

But how about if I want to lay out my grid in percentage terms? 20% for Column 1, 34% for Column 2, 28% for Column 3 and Auto, or 'the rest' for Column 4? There doesn't seem to be an option for this. GridUnitType.Star isn't explained well anywhere, but in any case it doesn't lay things out in percentage terms.


  • KSamuelsenKSamuelsen USMember ✭✭

    The star option will achieve the same; you can use it together with a value. For instance, if you have two columns, one with width = 1* and one with width = 2*, the second column takes up double the space of column one.

Sign In or Register to comment.