-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CollectionView's VerticalOptions are not working as intended on iOS. #14966
Comments
Trying out your repro project; I wonder if the root issue is the CollectionView layout in general. Based on your Grid, there should still be a visible button at the bottom of the Grid, but it's not. It seems like CollectionView is always taking up the rest of the space in a given area, regardless of the rest of the layout, and that's the bug. @hartez What do you think? |
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
Hi, @drasticactions Shifted the first row down one.
The results are as follows. Shifted the first row down two.
The results are as follows. On Android both results reflected the height of the elements in the CollectionView. Android results are what I expected. |
Pretty sure this is a duplicate of #9135. |
Thank you to everyone involved in fixing this issue. |
I set the height in code by items height. |
Description
Layout as below to reproduce the problem.
The layout above is a simple layout with a CollectionView in the 1st row of the Grid,
a Button in the 2nd row, and a Grid in the 3rd row. The CollectionView in the 1st row is a
5-column display with an element height of 60 and the VerticalOptions of the
CollectionView is Start.
On iOS, the entire screen is filled even though Start is specified in the VerticalOptions
of the CollectionView on the 1st row. VerticalOptions are not reflected as intended.
[.NET MAUI iOS]
On Android the CollectionView's VerticalOptions are working as intended.
[.NET MAUI Android]
In Xamarin.Forms, we know that we have the following issues:
xamarin/Xamarin.Forms#5942
Xamarin.Forms uses Frame instead of Border, but wrapping a CollectionView into a StackLayout
doesn't get around the problem. In Xamarin.Forms the 1st row CollectionView and the 2nd row
Button are displayed and for some reason the 3rd row is not displayed.
Any good ideas?
Steps to Reproduce
The steps to reproduce are as follows.
As of step 1, the 1st row of the Grid's CollectionView fills the entire screen.
Grid on the 2nd row and Button on the 3rd row are not displayed.
I expected the CollectionView to be top aligned depending on the number of
elements inside the CollectionView. (I expected it to be displayed in the same
way as the Android execution result.)
Link to public reproduction project repository
https://github.com/cat0363/Maui-IssueCollectionView.git
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 16.4
Did you find any workaround?
If you don't need the nice benefits of CollectionView, you can get around it by
using FlexLayout and BindableLayout instead of CollectionView.
Layout as follows.
I have 5 columns by setting FlexLayout.Basis="19.99%". Note that FlexLayout.Basis="20.00%"
does not result in 5 columns. This is because the Margin of the FlexLayout has been set.
Set ItemsSource like this:
I don't want it this way, although I get the expected result.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: