.NET MAUI Adds New Layouts
Written by Kay Ewbank   
Tuesday, 24 August 2021

 .NET 6 Preview 7 has improved .NET MAUI with new layouts, which the team says is a significant change for performance and reliability. .NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.

The new layouts replace the original layouts, which were reworks of the old Xamarin.Forms layouts edited to be ware of how to size and position both renderers and the new handler based controls. The developers say they took this approach to quickly have a UI available, while focusing their efforts on completing the library of UI 40 controls.


However, they have also been building optimized layouts based on a new LayoutManager approach, and these new layouts have now been made the default. The old layouts are still available, but you have to look in the Microsoft.Maui.Controls.Compatibility namespace.

The new layouts cover Grid, FlexLayout, StackLayout, HorizontalStackLayout and VerticalStackLayout. Each layout has an accompanying LayoutManager responsible for measuring and positioning views.


Alongside the new layouts, the preview has a number of changes and additions to the accessibility support, starting with the removal of the TabIndex and IsTabStop. These were introduced in Xamarin.Forms to help developers control the order in which UI elements would be read by a screen reader. However, the developers say that in practice, they ended up being confusing and not meeting that need. In .NET MAUI the recommendation is that you take a "thoughtful design approach that orders your UI as you would want it to be read, rather than looking for programmatic ways to manipulate the structure of your interface."

Another change to improve accessibility is the addition of new SetSemanticFocus and Announce methods. The SetSemanticFocus method is part of the new SemanticExtensions class, and allows you to move screen reader focus to a specific element. The second addition, Announce, sets the text to be announced by the screen reader. The final improvement for accessibility is the enabling of font scaling by default on all controls across all platforms. This means as your application users adjust their text scaling preferences in the OS, your UI will reflect their choice.

.NET MAUI is part of the latest .NET preview, and is available now.


More Information

MAUI On GitHub

Related Articles

Microsoft Will Replace Xamarin Forms With MAUI .NET

.NET 6 Preview Adds MAUI

Visual Studio 2022 Preview 2 Targets Productivity

Developer Preview Of .NET 6 Released

New In Windows Forms .NET

Xamarin Forms 3.0 Adds Visual State Manager


To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.


Commemorating Gordon Bell

Gordon Bell, the pioneering computer engineer who was responsible for the most successful machines of the mini computer era and co-founded the Computer History Museum, died on May 17, 2024 at the age  [ ... ]

Meet Ambidex and Rookie From NAVER

Robots may not be ready yet for the great takeover of jobs that some people fear, but in South Korea, where there are 1,000 robots per 10,000 workers, service robots are finding a role. 

More News

C book



or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 24 August 2021 )