Bug 28391 - ViewCell in a GroupHeaderTemplate defaults to Height=0 on iOS
Summary: ViewCell in a GroupHeaderTemplate defaults to Height=0 on iOS
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.4.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-03-24 18:32 UTC by Jeremy Herbison
Modified: 2016-03-16 01:47 UTC (History)
9 users (show)

Tags: AC
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jeremy Herbison 2015-03-24 18:32:38 UTC
The following xaml displays a properly-sized header on Android and WPhone, but is completely invisible on iOS unless you set the header ViewCell's Height property.

        <ListView ItemsSource="{Binding Encounters}" ItemTappedCommand="{Binding EditEncounterCommand}" IsGroupingEnabled="True" HasUnevenRows="True">
              <ViewCell Height="must be set on iOS">
                <StackLayout BackgroundColor="Accent" Padding="10">
                  <Label Text="{Binding Key}" TextColor="White" />
                <Grid Padding="10">
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <ColumnDefinition Width="90" />
                    <ColumnDefinition Width="Auto" />
                  <Label Text="{Binding Time}" Grid.Row="0" Grid.Column="0" />
                  <Label Text="{Binding DisplayName}" LineBreakMode="NoWrap" Grid.Row="0" Grid.Column="1" />
                  <Label Text="{Binding IsComplete}" Grid.Row="1" Grid.Column="1" FontSize="Micro" />
Comment 2 Ethan Nagel 2015-05-15 13:17:57 UTC
I struggled with this for quite a while! Glad to find from this post that it can be worked around by setting the ViewCell's height manually. Can we get this fixed? Seems to work on iOS 7 but not on iOS 8.
Comment 3 Rui Marinho 2015-07-30 07:13:30 UTC
Story but i m not being able to replicate this in iOS 8.4, @Prashant the testcase is not available anymore.

@Jeremy are you still being the issue with the latest 1.4.4 stable ?

here's the code i used to try to reproduce.

>                        ist = new ListView {
>			ItemTemplate = new DataTemplate (() => {
>				Label name = new Label();
>				name.SetBinding (Label.TextProperty, "FullName");
>				Label title = new Label { Font = Font.SystemFontOfSize (NamedSize.Micro) };
>				title.SetBinding (Label.TextProperty, "Title");
>				return new ViewCell { View = new StackLayout  {
>					Children = {
>						name,
>						title
>					}
>				} };
>			}),
>			IsGroupingEnabled = true,
>			GroupHeaderTemplate = new DataTemplate(() => {
>				Label name = new Label();
>				name.SetBinding (Label.TextProperty, "Key");
>				return new ViewCell { View = new StackLayout  {
>						Padding = new Thickness(10,10),
>						Children = {
>							name
>						}
>					} };
>			}),
>			HasUnevenRows = true
>		};
Comment 4 Simon Taylor 2015-08-04 21:36:57 UTC
This issue has gone away for me with 1.4.3 on iOS 8.4.
Comment 5 Samantha Houts [MSFT] 2016-03-16 01:47:04 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we no longer believe it affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team