Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] [iOS] Group Header does not expand to include all contents of ViewCell in GroupHeaderTemplate. #6014

Closed
jgold6 opened this issue Apr 26, 2019 · 1 comment
Labels
s/unverified New report that has yet to be verified t/bug 🐛

Comments

@jgold6
Copy link
Contributor

jgold6 commented Apr 26, 2019

This was originally filed on bugzilla: https://bugzilla.xamarin.com/show_bug.cgi?id=45773

Description

On iOS, the group header of a ListView does not expand based on the content of the ViewCell. This is true if the ViewCell has only one Label in it, or if the ViewCell has a StackLayout with multiple elements in it.

Steps to reproduce

  1. Open the attached sample project (thank you Code Knox (SO) /NightOwl (Xam Forums)

  2. Launch to iOS simulator or device.

Expected result: The two green background labels will be entirely within the Orange background StackLayout, which is the first child element of the GroupHeaderTemplate's ViewCell.
Screenshot: http://screencast.com/t/QTU6PcRmWxmg
Note that the above expected result was achieved just by setting the height of the ViewCell to 100, and obviously is not a solution as there is too much space for the header in the first group header, but enough for the second which has more text.

Actual result: The two green background labels extend below the orange background StackLayout
Screenshot: http://screencast.com/t/tsQkn1Pmtg

Note

So it would seem that the calculation of the hight for the Header cell does not take into account the height of the child elements. The StackLayout (orange background) fills the full height and width of the header cell on iOS, but the labels (green background) extend outside of their parent StackLayout container.

This bug was originally reported on SO [1] and the Xamarin Forums [2] 2.5 years ago.

[1] http://stackoverflow.com/questions/40143384/listview-groupheadertemplate-with-fixed-height-on-ios
[2] https://forums.xamarin.com/discussion/80698/listview-groupheadertemplate-fixed-height-on-ios

  • Version with issue: 4.0-pre9
  • Last known good version: no known good version
  • IDE: VS for Mac
  • Platform Target Frameworks:
    • iOS: 12.8.0.0
  • Nuget Packages: Xamarin.Forms and its dependencies
  • Affected Devices: Tested on iOS iPhone Xr 12.2 simulator

Screenshots

These are from the original bug report, so they are of an older simulator, but it looks the same on an iOS iPhone Xr 12.2 simulator.

Screenshot expected: http://screencast.com/t/QTU6PcRmWxmg

Screenshot actual: http://screencast.com/t/tsQkn1Pmtg

Reproduction Link

GroupHeaderTemplateLayoutErroriOS.zip

@jgold6 jgold6 added s/unverified New report that has yet to be verified t/bug 🐛 labels Apr 26, 2019
@nbevans
Copy link

nbevans commented Apr 26, 2019

#3769

Dupe of this. I already proposed a fix and provided immediate workaround in form of a renderer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

3 participants