[iOS] CollectionView2 - empty view - improvements#28119
[iOS] CollectionView2 - empty view - improvements#28119kubaflo wants to merge 2 commits intodotnet:mainfrom
Conversation
|
Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
left a comment
There was a problem hiding this comment.
Can include an UITest using the same from #28118? Can use methods to try to drag the EmptyView and verify the position for example with a reference snapshot.
src/Controls/src/Core/Handlers/Items2/iOS/ItemsViewController2.cs
Outdated
Show resolved
Hide resolved
src/Controls/src/Core/Handlers/Items2/iOS/ItemsViewController2.cs
Outdated
Show resolved
Hide resolved
Added |
|
/rebase |
74d5dac to
4be364b
Compare
4be364b to
8ea0e36
Compare
|
|
||
| if (isEmpty) | ||
| { | ||
| CollectionView.LayoutIfNeeded(); |
There was a problem hiding this comment.
Why do we need to call this if we setting the ContentInset wouldn't t that call layout?
There was a problem hiding this comment.
Turns out it doesn't. I tried without it on the latest main and it doesn't work
| RemeasureLayout(_emptyViewFormsElement); | ||
| frame = new CGRect(frame.X, frame.Y, frame.Width, Math.Max(frame.Height, _emptyViewFormsElement.Height)); | ||
| _emptyUIView.Frame = frame; | ||
| CollectionView.ContentInset = new UIEdgeInsets(0, 0, frame.Height, 0); |
There was a problem hiding this comment.
IS this the best way to do it ? Why do we need to inset?
There was a problem hiding this comment.
Without it, a CollectionView with an empty view whose height exceeds the frame won't scroll.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
rmarinho
left a comment
There was a problem hiding this comment.
Some questions, special related with inset, should we try add EmtptyView in other way so CollectionView knows how to handle properly without use of insets?
I can look into it further, unless you already have something specific in mind. |
|
closing in favor of #29154 |
Issues Fixed
Fixes #28118
Screen.Recording.2025-03-01.at.16.06.17.mov
Screen.Recording.2025-03-01.at.16.04.15.mov