Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Xamarin.Forms listview on iOS does not obey xaml RowHeight

$
0
0

Hi,

I have the following layout wich works perfectly on android devices, but gives wrong row height on iOS.

Edit: Actually, the row does have the correct height, but for some reason the contents get "cropped"... Or maybe the Grid VerticalOptions='FillAndExpand' doesn't work properly.


<ListView x:Name="listView"
                          CachingStrategy="RecycleElement"
                          BackgroundColor="{StaticResource primary_light}"
                          IsVisible="True"
                          IsPullToRefreshEnabled="True"
                          HasUnevenRows="False"
                          Refreshing="PullToRefresh"
                          RowHeight="70">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>
                                <Grid BackgroundColor="White" Padding="0,0,10,0" VerticalOptions="FillAndExpand">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>

                                    <StackLayout Orientation="Horizontal"
                                                 HorizontalOptions="Start"
                                                 Padding="10"
                                                 BackgroundColor="{Binding IsAlarmed,Converter={StaticResource BoolToColorConverter}}"
                                                 WidthRequest="60">
                                        <Image Source="{Binding ImageFilename}"
                                           VerticalOptions="FillAndExpand"
                                           HorizontalOptions="FillAndExpand" />
                                    </StackLayout>

                                    <StackLayout Orientation="Vertical"
                                             Grid.Column="1"
                                             Grid.ColumnSpan="3"
                                             VerticalOptions="Center"
                                             Padding="10,0,0,0"
                                             Spacing="0"

                                             >
                                        <Label Text="{Binding Etiqueta}" FontSize="22" Margin="0,10,0,0" TextColor="{StaticResource primary_text}"/>
                                        <Label Text="{Binding DataHoraColeta}" TextColor="{StaticResource secondary_text}" FontSize="15" />

                                    </StackLayout>

                                    <StackLayout Orientation="Vertical"  Grid.Column="4" Spacing="-1" VerticalOptions="Center" Margin="-15,0,0,0">
                                        <StackLayout Orientation="Horizontal">
                                            <Label Text="Set:" TextColor="BlueViolet" />
                                            <Label Text="{Binding PontoReferencia}" FontSize="15" TextColor="BlueViolet"/>
                                        </StackLayout>
                                        <StackLayout Orientation="Horizontal">
                                            <Label Text="Ret:" TextColor="YellowGreen"/>
                                            <Label Text="{Binding Retorno}" FontSize="15" TextColor="YellowGreen"/>
                                        </StackLayout>
                                        <StackLayout Orientation="Horizontal">
                                            <Label Text="Sup:" TextColor="Red" />
                                            <Label Text="{Binding Fornecimento}" FontSize="15" TextColor="Red"/>
                                        </StackLayout>
                                    </StackLayout>

                                </Grid>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>

Has anyone experienced this?

Thanks in advance.


Viewing all articles
Browse latest Browse all 204402

Trending Articles