0

I am using Listview with Viewcell height set according to content.it work Fine for windows and android when i set Attribute for Listview HasUnevenRows=True but for Ios it doesn't not work proper.

 <ListView x:Name="LstNotification"
            Grid.Row="0"
            HasUnevenRows="True"
            SeparatorVisibility="None">
    <ListView.ItemTemplate>
      <DataTemplate>
        <ViewCell>
          <ViewCell.View>
            <Grid BorderColor="#A4C0D4" InnerBackground="#fafcff" BorderWidth="2" Margin="10,5" >
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <StackLayout Grid.Row="0" Margin="10,5">
                <Label Text="Know Your Medicine" TextColor="#1a1b1c" LineBreakMode="WordWrap" FontAttributes="Bold"/>
                <Label Text="{Binding message}" TextColor="#1a1b1c" LineBreakMode="WordWrap"/>
              </StackLayout>
              <Grid Grid.Row="1" InnerBackground="#d8dbdd" HeightRequest="1"/>
              <Grid Grid.Row="2" Margin="10,5">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="7.5*"/>
                  <ColumnDefinition Width="2.5*"/>
                </Grid.ColumnDefinitions>
                <Label Grid.Column="0" TextColor="#8b8d8e" FontAttributes="None" Margin="0,5"/>
                <Image Grid.Column="1" Source="bin.png" HeightRequest="15"
                       WidthRequest="15" HorizontalOptions="EndAndExpand" Margin="0,0,10,0"/>
              </Grid>
            </Grid>
          </ViewCell.View>
        </ViewCell>
      </DataTemplate>
    </ListView.ItemTemplate>
  </ListView>
Kcs computer
  • 121
  • 1
  • 4
  • 13
  • Possible duplicate of [Xamarin.Forms - Force ListView layout to redraw](http://stackoverflow.com/questions/37414063/xamarin-forms-force-listview-layout-to-redraw) – Prashant Cholachagudda Oct 19 '16 at 09:38
  • This is something that is much discussed. Have a look at the topic in the [Xamarin Forums](http://forums.xamarin.com/discussion/comment/225351) here as well for possible solutions. – Gerald Versluis Oct 19 '16 at 09:52
  • not sure if iOS supports uneven raws , but if it does then maybe you just need to clean your project and rebuild it . Small and not related hint: when you define your grid avoid using Auto to set the size as it bad for performance :) – Ahmad ElMadi Oct 19 '16 at 10:30

0 Answers0