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

How to specify RowDefinitions and Column Definitions of Grid layout in XAML for different platforms

$
0
0

Hi experts,

As subject, here is my XAML code. But I got "There is no Height and Width property...." exception while compiling. I know the type of Height and Width should be GridLength but I have no idea to specify in ResourceDictionary.

        <ContentPage.Resources>
            <ResourceDictionary>
              <OnPlatform x:Key="GridSize"   x:TypeArguments="x:Double"  iOS="50"  Android="100" WinPhone="100" />
            </ResourceDictionary>
          </ContentPage.Resources>
        ........
        <Grid>
         <Grid.RowDefinitions>
                <RowDefinition Height="{StaticResource GridSize}" />
              </Grid.RowDefinitions>

              <Grid.ColumnDefinitions>
                 <RowDefinition Height="{StaticResource GridSize}" />
              </Grid.ColumnDefinitions>
        </Grid>

Any directions and hints will be appreciated. Thanks in advance.


Viewing all articles
Browse latest Browse all 89864

Trending Articles