Forum Xamarin Xamarin.Forms

Viewcell contents is not taking the full page width within Windows Phone platform.

TomWalkerTomWalker CAInsider, University, Developer Group Leader ✭✭


I'm trying to figure how to make my Viewcell contents to take the full width of the page within the Windows Phone platform. This behavior is not happening within the Android client.

The full source code can be found on my github:

Gird xaml code just in case:
Grid Padding="20"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions>

How I'm defining my ListView xaml
<ListView Grid.Row="1" Grid.Column="0" HorizontalOptions="FillAndExpand" x:Name="list" ItemsSource="{Binding Recipes}" ItemTapped="OnItemSelected"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <StackLayout Orientation="Horizontal" Spacing="25"> <Image Source="{Binding Image}" WidthRequest="40" HeightRequest="40" /> <Label Font = "15" HorizontalOptions="FillAndExpand" Text="{Binding Name}"/> </StackLayout> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView>


  • TomWalkerTomWalker CAInsider, University, Developer Group Leader ✭✭
    edited June 2014

    I managed to fixed. Within my Grid element I added another column definition and set the children elements to span both columns. If someone else has a better solution let me know.

    <Grid Padding="20"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions>

    <StackLayout Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" Padding="0,0,0,20" >

  • cassioamcassioam CAMember

    Thanks for posting the solution. I had the same problem on iOS and your solution worked. This is definitely a bug though.

Sign In or Register to comment.