Bug 22093 - When having a ColumnDefinition with One column like below make iOS app crash and if I remove it Windows Phone apps layout wrong.
Summary: When having a ColumnDefinition with One column like below make iOS app crash ...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.2
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-08-14 04:19 UTC by Henrik Stromberg
Modified: 2016-03-16 12:18 UTC (History)
4 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Henrik Stromberg 2014-08-14 04:19:37 UTC
When having a ColumnDefinition with One column like below make iOS app crash and if I remove it Windows Phone apps layout wrong.

<?xml version="1.0" encoding="utf-8" ?>
<xflm:BaseView xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:xflm="clr-namespace:Xamarin.Forms.Labs.Mvvm;assembly=Xamarin.Forms.Labs"
             xmlns:glcc="clr-namespace:Galore.Lunch.Controls;assembly=Galore.Lunch"
             xmlns:views="clr-namespace:Galore.Lunch.Views;assembly=Galore.Lunch"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:glcr="clr-namespace:Galore.Lunch.Core.Resources;assembly=Galore.Lunch.Core"
                                                                              x:Class="Galore.Lunch.Views.MainView">
    <xflm:BaseView.Resources>
        <ResourceDictionary>
            <OnPlatform x:TypeArguments="Thickness" x:Key="ItemMargin" WinPhone="4,0,4,4" iOS="4,0,4,4" Android="4,0,4,4"/>
            <OnPlatform x:TypeArguments="Thickness" x:Key="TextMargin" WinPhone="4,0,0,0" iOS="4,0,0,0" Android="4,0,0,0"/>
            <OnPlatform x:TypeArguments="sys:Int32" x:Key="RowHeight" WinPhone="100" iOS="60" Android="60"/> />
        </ResourceDictionary>
    </xflm:BaseView.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="35" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <BoxView Color="#FF1F95FD" />

        <StackLayout Padding="{StaticResource TextMargin}">
            <Label Text="{Binding ActiveFilterText}" Font="Bold,Medium" />
        </StackLayout>

        <glcc:CommandAwareListView
            ItemsSource="{Binding Dishes}"
            Command="{Binding ShowRestaurantCommand}"
            HasUnevenRows="False" 
            RowHeight="{StaticResource RowHeight}"
            Grid.Row="1">
            <glcc:CommandAwareListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>

                        <Grid ColumnSpacing="2" RowSpacing="0" Padding="{StaticResource ItemMargin}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="65" />
                            </Grid.ColumnDefinitions>
                            <Label Text="{Binding Name}" />
                            <!--LineBreakMode="TailTruncation"-->
                            <Label Text="{Binding RestaurantName}" Grid.Row="1" Font="Italic" TextColor="#FF1F95FD"/>
                            <Label Text="{Binding PriceText}" Grid.Column="1" HorizontalOptions="EndAndExpand" VerticalOptions="Start" />
                            <Label Text="{Binding DistanceText}" Grid.Row="1" Grid.Column="1" HorizontalOptions="EndAndExpand" TextColor="#FF1F95FD" />
                            <StackLayout Padding="-4,4,-4,0" Grid.Row="2" Grid.ColumnSpan="2">
                                <BoxView Color="#FF1F95FD" HeightRequest="2"/>
                            </StackLayout>
                        </Grid>


                    </ViewCell>
                </DataTemplate>
            </glcc:CommandAwareListView.ItemTemplate>
        </glcc:CommandAwareListView>
    </Grid>
</xflm:BaseView>
Comment 1 Seth Rosetter 2014-08-14 14:43:43 UTC
This code seems to work just fine with a regular Forms.ListView. Would you mind attaching or emailing the implementation of the CommandAwareListView?
Comment 2 Jason Smith [MSFT] 2016-03-16 12:18:28 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