-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] ListView Group Header size incorrect on iOS #3769
Comments
what happend to this issue? |
This is surely a priority 1 issue? |
For anyone who cares, this issue still happens as of Forms 3.6 latest at this time. I just updated this morning to check. |
There are historical threads on the old Xamarin Forums dating back to 2014 discussing this issue. It's also on the Bugzilla in various issues. We are now in 2019 and still XF on iOS cannot properly adjust for height of a ListView Header. Let that sink in for a minute... ;-) I've looked at the relevant bits of source code in XF and it actually looks quite trivial to fix. Basically, it isn't using the AutomaticDimension that iOS has supported for a while now. Which is odd because XF did implement support for this on regular rows... go figure. In the next day or two I am going to have a go at making a custom renderer to fix it. |
This wrapper view that wraps all section headers is the root cause of the problem. The way it is laying out the subviews like that is quite bizarre and will certainly be screwing up iOS' AutoLayout mechanism which is needed to support AutomaticDimension. |
I've got a fix, both in the form of a Renderer hackfix but also as a proposed patch to XamForms. The proposed patch is: Change the HeaderWrapperView class as follows:
Change the GetViewForHeader method as follows:
|
And here is my renderer hackfix for those that need an immediate solution to use whilst they wait for the above patch to be incorporated in a new release of XF: https://gist.github.com/nbevans/a713dc9c77a8f530b6f4f3cd4fad83c2 |
@samhouts ? That new inactive tag really seems effective! ;-) |
Will my fix ever get merged in? |
Im waiting for this fix to be merged, @samhouts when can we expect this fix to be merged? thanks and keep up the good work both of you :) |
@nbevans Would you care to submit a pull request? Thanks! |
Has this been fixed in Xamarin Forms? If so, which version? |
@nbevans I’ve incorporated your fix here: https://github.com/xamarin/Xamarin.Forms/blob/fix-3769/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs The only thing I’m worried about is the backwards compatibility. Before this, the header would have a certain height. People might depend on that now. With this fix the height, when not setting the height explicitly, will suddenly be determined automatically. |
Would like to know what will be the version with this fix |
That's great. As far as the backcompat is concerned we could introduce a property to enable/disable the automatic height mode (and default it to disabled to maintain compat) When can this be merged into the mainline @samhouts ? |
Yes this is quite a pain, hoping soon!! |
Do we know in which Xamarin.Forms version this bug will be fixed? It's quite painful. |
I just upgraded to XF ver. 4.7 but this issue is still there. Anyone else facing a similar issue? and Do we know in which Xamarin. Forms version this bug will be fixed? |
@samhouts @jamesmontemagno Pretty please can this fix be sorted out? |
I am now seeing this exception when I upgraded to Xamarin.Forms 4.8 the other day. Does anyone have a workaround to the renderer given by @nbevans to solve this new issue? |
I think my fix was broken when they made this commit: ff74a81#diff-198607f4ce97efcc515a271473524b08 My fix needs some tweaks to make it work with this change. |
Thanks @nbevans So I replaced the following 2 lines in your renderer hackfix
with
And now it seems to work okay without the crash. |
That looks like a good stop-gap fix. It would really ideal if Xamarin Forms team just included my fix in the core codebase. It looks like they're now eyeing v5.0 to include this fix but that is a shame since my understanding is that v5.0 is the MAUI release - so does that mean Xamarin Forms will never actually get this fix before it enters the 2 year maintenance-only period? |
Important fix for me too |
For all guys out there who want to make the groupheader invisible, you have to set the ViewCell Height on iOS to 0.0001 or something like that but not zero |
@samhouts not anymore? |
a definitive fix is really needed! |
Please fix It!! @samhouts @jsuarezruiz @PureWeen @hartez can you prioritize it?? There isn't either a workaround!!!! :( |
It feels great to still experience this bug unfixed in 2021. Feels like being part of something historical. |
Could be worse. We could be stuck on the Flutter framework and pulling our hair out because word-wrap doesn't work properly and making ourselves unemployable because nothing else uses the esoteric Dart language. |
I'm in a funny situation:
|
The hack actually crash the app sometimes when ListView has no headers |
The @nbevans fix has a little bug with the latest XF version. See this: https://gist.github.com/nbevans/a713dc9c77a8f530b6f4f3cd4fad83c2#gistcomment-3471173 @jfversluis Can the fix you created for this get a little bit of love? 🥰 |
Unfortunately I have lost all my powers on this repo ;) so you PR is just as good as mine. Feel free to take it! :) I would love to help out, but I am tied up in all kinds of other things at the time being... Sorry! |
Description Basic Information Version with issue: Xamarin forms service pack 11 and below versions too Screenshots: Any help would be appreciated. |
@vangalasrihitha Did you find any workaround for this? We are having similar issue |
Still have this issue in Xamarin.Forms 5.0.0.2545. |
We are migrating to this library with (for now) really good and performant results: https://www.sharpnado.com/collectionview-maui/ |
Description
When using a grouped ListView with a custom header template, Android and UWP expand the header size.
iOS has a set height to the cell, and then overflows to write over the children cells
Steps to Reproduce
Run the supplied project on iOS. See it look like trash.
Expected Behavior
Headers resize
Actual Behavior
They do not.
Basic Information
Ran on iOS simulator and a real device on iOS 11.3 and 11.4.
Never seen it work, been around since 1.3
Screenshots
iOS:
UWP:
Reproduction Link
ListViewHeaderRpo.zip
The text was updated successfully, but these errors were encountered: