.Net MAUI, Xamarin

#7DaysChallenge โ€“ Day 6: Proportional and Auto values with Grid in Xamarin & .NET MAUI

Hello!! ๐Ÿ™‹โ€โ™€๏ธ Continuing with the #7DaysChallenge initiative, as our sixth challenge, we’re going to work withย Proportional and Auto values with Grids in Xamarin and .NET MAUI!

The challenge shows you a code which you must analyze carefully to see the final result!ย The solution is below, but don’t see it before analyse your answer! Let us begin!

I invite you to take a look at all the challenges of this initiative, each of them has its technical explanations and recommended articles to study! You can give them an eye in the article #7DaysChallenge with Xammy.


Let’s start!

๐ŸŽฏ Day 6- Proportional and Auto values with Grids.

La imagen tiene un atributo ALT vacรญo; su nombre de archivo es 7DaysChallenge-Day-6-Challenge-1024x612.png

Do you already have the answers? ๐Ÿ‘€๐Ÿ‘€๐Ÿ‘€

๐Ÿ’ก Click here to see the solution

The correct answer is the option A! ๐ŸŽŠ

The correct answer is A due to the following points:

The Grid has the correct amount of rows and columns and they are positioned in the correct ones, the difference here is that one option has the rows and columns with proportional values โ€‹โ€‹(*) and the other option is mixed with Auto values.

So what does it mean?

โšช Auto: This type resizes the row or column depending on the size of the children on its content. In the XAML is named โ€œAutoโ€.

โšช Proportional (*): This type sizes columns and rows as a proportion of the remaining space.

That’s why, the correct option is A.

Let’s see an example of how the results of both options are: La imagen tiene un atributo ALT vacรญo; su nombre de archivo es 7DaysChallenge-Day-6-OptionAnswer-1024x778.png

Recommended resources:

Important to know: This code will work for you in the same way both in Xamarin Forms and in .NET MAUI! ๐Ÿ’•

If you want to delve into Grids, I recommend you the following article.

Working with GridLayout in Xamarin Forms


I hope you liked it and it was useful!

I’ll wait for you in the next challenge! ๐Ÿ˜Ž Thank for reading! ย ๐Ÿ’š๐Ÿ’•

Tagged , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *