-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[net7.0] Ensure that Grid is treating star rows/columns as Auto when unconstrained #14165
Conversation
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
…unconstrained (#14165) * Ensure that Grid is treating star rows/columns as Auto when unconstrained Fixes #13993 * Auto-format source code --------- Co-authored-by: E.Z. Hart <[email protected]> Co-authored-by: GitHub Actions Autoformatter <[email protected]>
The #14165 'Ensure that Grid is treating star rows/columns as Auto when unconstrained' brakes existing grid layouts for iOS. If I click the Hide button to hide the control (CollectionView) the Label and button beneath the CollectionView appear at the correct position with the iOS Save Area. I can toggle the Collection IsVisible back to true using the same button and the CollectionView will push the Label with text out of the Safe Area and off the visible portion of the screen. I could not find which MAUI controls are officially 'unconstrained'. A map control placed into a star height row also pushes down controls in auto height rows beneath it. If change the 'star' row to 'auto' in VS2022 Hot Reload the iOS screen does not change. In the below iOS iPhone 14 Pro simulator screenshot the CollectionView has two items and still pushes the controls below it off screen. The same code with the Collection View in the 'auto' height row running in the Google Pixel 5 simulator. Android CollectionView (Windows too) exhibits constraint. If it has 2 rows it will occupy space for 2 rows and will resize when more added, or some removed. iOS CollectionView is a different beast. I am aware of it. In my Xamarin apps I have CollectionView controls in 'star' and in 'auto' rows, depending on the context. Handling a CollectionView in a grid 'auto' row can be tricky. My code must calculate the HeightRequest. This works well if there is a star row in the grid that can shrink or expand. It works great in Xamarin. In MAUI it depends what kind of control is in the star row and how well or not MAUI GridLayoutManager handles the 'star' row content. If I place a map control into the star grid row in MAUI iOS app and I have a CollectionView in the 'auto' grid row below the map, it was already not handled gracefully prior to #14165. After I upgraded VS2022 to 17.6.2 it got worse. Now in addition to the CollectionView not always rendered at a correct position the lower grid row is cut off at the bottom of the screen. I didn't have these issues when using Xamarin.Forms. The last MAUI update forced me to put a transition to MAUI project on hold. Not that I am much upset about that. The Xamarin app I was moving runs faster than the MAUI version, screen refresh cleaner. I suggest restoring previous functionality where star rows are treated as star rows. |
Besides grids, map control fell victim to #14165 'treating star rows as auto' under iOS. The page layout is a grid, the top 'star' row has a map control, the bottom 'auto' row has a grid with navigation buttons. A click on the info button shows a label with the copyright notice. The label is in an 'auto' row initially hidden. When the row with the copyright label became visible it pushed down the bottom navigation bar instead of pushing up the map lower border. I made the page look as it should by setting map MaximumHeighRequest to 0. <Map x:Name="map" Grid.Row="0" MaximumHeightRequest="0"/> This silly trick doesn't work well for grids. |
Backport of #13999 to net7.0
/cc @PureWeen @hartez