|.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.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Tuesday, 24 August 2021 )|