maui
maui copied to clipboard
CollectionView where items are sized to fit the screen
Description
I'd like an option for items to be sized to expand to fill the area when the items would be too small.
[Migrated from Xamarin.Forms] https://github.com/xamarin/Xamarin.Forms/issues/7451
Public API Changes
Add property bool FillArea. When true, the control will split the view among the items evenly and fill the entire area. If the size of the items controlled by ItemSizingStrategy would be less than HeightRequest/WidthRequest of the item, the control would revert to normal layout behavior for that dimension.
Intended Use-Case
Example: Imagine an application that contains one or more graphs, and a user can decide how many they want to show. The repeated pattern and variable number is best represented by a CollectionView-type control with an ItemsSource and DataTemplate. However, the user may only have one or two graphs, which are best displayed by filling the screen. With more graphs, they can shrink until a minimum size is reached, after which scrolling behavior can be used.
As of now, there is no easy way to achieve this that I am aware of.
Here's a mockup of what I mean:

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
years later, some of us are looking for this feature - thinking we are just not coding something correctly. when in fact it is actually something that MAUI isn't capable of doing (at least not through normal means).
kinda disappointing.
years later, some of us are looking for this feature - thinking we are just not coding something correctly. when in fact it is actually something that MAUI isn't capable of doing (at least not through normal means).
kinda disappointing.
Yes, it's frustrating. It is such an important thing for a UI to look fine and usable, yet again, nobody seems to care. BindableLayout is an alternative only when no selection is needed. It is just so stupid if you ask me.
I end up doing dynamic calculations using:
- OnSizeChanged page events;
- Based on Width Screen;
- Using a FlexLayout to be possible to define the alignment with FlexJustify;
- Was able even to use MVVM with a List;