Horizontal & VerticalStackLayout in .NET MAUI

Howdy! 🙋‍♀️ Continuing with ☃️ Coding Winter 2021 – C # and .NET MAUI ❄️” initiative, today is #DayFifteen and we will be learning about Semantic Focus in .NET MAUI!

Probably when reading the title you were surprised,😯 Horizontal and Vertical Stacklayout? Yes, you read that right!! In Preview 7, .NET MAUI introduced both types of layouts! In this article, I will show you its easy implementation.

Let’s start!

Microsoft developers team has been working on identifying opportunities for optimization, performance improvement, and as well, on providing a better experience both in development time and in the maintenance of our applications. Therefore, we have a new set of Layouts taken from all these years of learning that Xamarin Forms brings, among these Layouts have VerticalStackLayout and HorizontalStackLayout. In this post, we will focus on both!

Each Layout has a LayoutManager which is responsible for measuring and positioning the views, as well as the secondary elements of the design. If you want to see more information about the others you can enter here.

How do I implement it?

The structure is very easy and maintains the same theme and objective as the designs we know from Xamarin Forms, let’s see.



And Done! 🤓 As simple as you see, and then add all the controls you need to get your desired UI!

⚠ These layouts will continue to be improved throughout the Sprints, it is important that you use it and if you identify an opportunity for improvement, you can report it here please! 💚

But what if I have to use the old Xamarin layouts?

You can do it very easily! 💕

You can find them in Microsoft.Maui.Controls.Compatibility namespace.

And done 😎 I hope this article has been super useful for you! ⭐️ Thanks for reading! 💚💕

Spanish post:


Tagged ,

5 thoughts on “Horizontal & VerticalStackLayout in .NET MAUI

Leave a Reply

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