Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

ListView GroupHeaderTemplate fixed height on iOS

$
0
0

Hey there guys, I'm trying to set a variable height list view on iOS. Our code (on the attached sample project and main part below) works fine on Droid, but fails miserably on iOS.
I have tried iOS 9.3 and iOS 10, with forms 2.3.2.127 and latest prerelease 2.3.3.163-pre3.

<ListView Grid.Row="2"
        ItemsSource="{Binding MenuSections}"
        IsGroupingEnabled="True"
        HasUnevenRows="True"
        SeparatorVisibility="Default"
        ItemTapped="ListViewOnItemTapped">
 
<ListView.GroupHeaderTemplate>
    <DataTemplate>
        <ViewCell>
            <StackLayout Padding="15,10,15,10"
                         Spacing="0"
                         BackgroundColor="Green">
                <Label Text="{Binding Name}"
                        LineBreakMode="TailTruncation"
                        TextColor="White"
                        FontSize="14"/>
 
                <Label Text="{Binding Description}"
                        Margin="0,0,0,10"
                        IsVisible="{Binding HasDescription}"
                        LineBreakMode="WordWrap"
                        TextColor="{StaticResource BSDirtyWhite}"
                        FontSize="11"/>
            </StackLayout>
        </ViewCell>
    </DataTemplate>
</ListView.GroupHeaderTemplate>

 
I have already removed everything above with only a Label, and got exactly same result. Looks like header height on iOS is fixed to some constant number.

Please also find attached the screen shots for Droid (working fine) and failed iOS 9.3 and 10.

Any help or workaround is greatly appreciated.
NightOwl


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>