.Net MAUI, Xamarin

#7DaysChallenge – Day 4: Padding, Marging & Translations in Xamarin & .NET MAUI

Hello!! πŸ™‹β€β™€οΈ Continuing with the 7DaysChallenge initiative, as our fourth challenge, we’re going to work with Padding, Margin and Translations 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 4- Challenge – Padding, Marging & Translations in Xamarin & .NET MAUI.

La imagen tiene un atributo ALT vacΓ­o; su nombre de archivo es Screen-Shot-2022-05-26-at-12.04.14-AM-1024x615.png

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

πŸ’‘ Click here to see the solution

The correct answer is the option B! 🎊

La imagen tiene un atributo ALT vacΓ­o; su nombre de archivo es Screen-Shot-2022-05-26-at-12.05.22-AM-1024x614.png

The correct answer is B due to the following points:

    • Padding property represents the distance between an element and its children, in this case, we have the Padding assigned to the Button, the content inside is the Text property, the Padding positioning values ​​will be applied to this property .

    • While the Margin property represents the distance between an element and its adjacent elements, and the Translations properties, directly move the axis X or Y.

Finally, I leave you the result of each of the three scenarios so that you can graphically perceive the difference.

La imagen tiene un atributo ALT vacΓ­o; su nombre de archivo es 7DaysChallenge-Day-4-Answer-Options-1-1024x559.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 Margin, Padding and Translations properties, I recommend you the following article.

Understanding the differences between Margin & Padding and Translation properties


I hope you liked it and it was useful!

I’ll wait for you in the next challenge! 😎 Thank for reading!  πŸ’šπŸ’•

Tagged , , , ,

2 thoughts on “#7DaysChallenge – Day 4: Padding, Marging & Translations in Xamarin & .NET MAUI

Leave a Reply

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