I create Xamarin Forms applications with the possibility of chat and i have problem with my chatPage. My code looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyApp.Chat.ChatRoomPage">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition
Height="*" />
</Grid.RowDefinitions>
<RefreshView
IsRefreshing="{Binding IsRefreshing, Mode=OneWay}"
Command="{Binding RefreshCommand}"
Grid.Row="0">
<CollectionView
x:Name="CollectionViewMessages"
ItemsSource="{Binding MessagesList}"
BackgroundColor="{ DynamicResource BasePageColor }">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid RowDefinitions="auto, auto">
<Grid IsVisible="{Binding IsOwnerMessage}">
<template:ChatRightMessageItemTemplate />
</Grid>
<Grid
Grid.Row="1"
IsVisible="{Binding IsOwnerMessage, Converter={converters:BooleanConverter}}">
<template:ChatLeftMessageItemTemplate />
</Grid>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</RefreshView>
<!-- Loading gif -->
<ActivityIndicator
Grid.Row="0"
IsRunning="{Binding IsBusy}"
HorizontalOptions="Center"
VerticalOptions="Start"
TranslationY="40"
InputTransparent="True"/>
</Grid>
<!--- Message Writing -->
<Grid
Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid
Grid.Row="0"
Margin="20,10,20,10"
ColumnSpacing="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Comment -->
<Editor
Grid.Column="0"
x:Name="entry"
AutoSize="TextChanges"
Margin="0,0,5,2"
FontSize="14"
Text="{Binding Message}"
HorizontalOptions="FillAndExpand"
VerticalOptions="End"/>
<!-- Send button -->
<Image
Grid.Column="2"
Source="SendMessageButton.png"
HorizontalOptions="End"
VerticalOptions="End"
WidthRequest="23"
HeightRequest="20"
Margin="0,0,0,10">
<Image.GestureRecognizers>
<TapGestureRecognizer Command="{Binding SendMessageCommand}"/>
</Image.GestureRecognizers>
</Image>
</Grid>
</Grid>
</Grid>
</ContentPage>
the effect of this is this:
This work well on Android but on iOS nope. After clicking something on the keyboard, the field for typing escapes below it and we cannot see what we are typing. In addition, when you switch the keyboard to emoji, its size changes and you cannot see what you are typing. The input field problem is solved if you use scrollview, but then the collectionview fills the entire screen and the input field is outside of it. How to solve this problem so that autosize and emoji work properly on iOS?
Related
The VerticalOptions="End" in my Xamarin Forms doesn't stick the items to the end of the page (which is what it should do right?), I even tried using an absolute layout with the relative position set to 1, but that didn't move the items to the end either.
Here is my Xaml:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:skia="clr-namespace:SkiaSharp.Views.Forms;assembly=SkiaSharp.Views.Forms"
x:Class="CouchTo5kTracker.HomePage">
<ContentPage.Content>
<Grid x:Name="MainGrid">
<Grid.RowDefinitions>
<RowDefinition Height="350"/>
</Grid.RowDefinitions>
<AbsoluteLayout x:Name="AbsoluteLayoutProgress" Grid.Row="0" HorizontalOptions="FillAndExpand">
<skia:SKCanvasView x:Name="canvasView" PaintSurface="OnCanvasViewPaintSurface" AbsoluteLayout.LayoutBounds="0, 0" AbsoluteLayout.LayoutFlags="XProportional"/>
<Label x:Name="WeekCounter" Text="3/5" FontSize="90" AbsoluteLayout.LayoutBounds="0.5, 100, 150, 150" AbsoluteLayout.LayoutFlags="XProportional"/>
<Label x:Name="WeekLabel" Text="Week" FontSize="30" AbsoluteLayout.LayoutBounds="0.5, 220, 80, 50" AbsoluteLayout.LayoutFlags="XProportional"/>
</AbsoluteLayout>
<StackLayout Grid.Row="1">
<Grid x:Name="RunGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3.75*"/>
<ColumnDefinition Width="1.25*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Grid.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/>
</Grid.GestureRecognizers>
<Frame Grid.Row="0" Grid.Column="0" BackgroundColor="#1476D2" Padding="10,5,5,5" Margin="8,0,1,5">
<Label Text="Next Run" VerticalOptions="Center" FontSize="15" FontAttributes="Bold"/>
</Frame>
<Frame Grid.Row="0" Grid.Column="1" BackgroundColor="#1476D2" Padding="10,5,5,5" Margin="1,0,8,5">
<Label Text="Date" VerticalOptions="Center" FontSize="15" FontAttributes="Bold"/>
</Frame>
<Frame Grid.Row="1" Grid.Column="0" BackgroundColor="#F7F7F7" Padding="10,5,5,5" Margin="8,0,0,5">
<Label x:Name="NextRunLabel" Text="Next Run: Week 4, Run 3" VerticalOptions="Center" FontSize="15"/>
</Frame>
<Frame Grid.Row="1" Grid.Column="1" BackgroundColor="#F7F7F7" Padding="10,5,5,5" Margin="1,0,8,5">
<Label x:Name="NextRunDateLabel" Text="12/04" VerticalOptions="Center" FontSize="15"/>
</Frame>
</Grid>
<Grid VerticalOptions="End">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Frame Grid.Column="0" Grid.Row="0" VerticalOptions="End"></Frame>
<Frame Grid.Column="1" Grid.Row="0" VerticalOptions="End"></Frame>
</Grid>
</StackLayout>
</Grid>
</ContentPage.Content>
</ContentPage>
Altering the heirarchy resuts in very unexpected positioning, at the moment I just want to place the two frames at the end of the page. The App is a Xamarin Shell.
Currently I use MasterDetailPage but I want to change my project model to Shell.
How can I generate FlyoutItems dynamically like my old version of MasterDetail?
<StackLayout>
<ListView x:Name="MenuItemsListView"
SeparatorVisibility="None"
HasUnevenRows="true"
ItemsSource="{Binding MenuItems}">
<ListView.Header>
<Grid BackgroundColor="#8f0000">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="80"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<Label
Grid.Column="1"
Grid.Row="2"
Text="{Binding Title}"
Style="{DynamicResource SubtitleStyle}"
TextColor="#d7d9b4"
FontSize="24"/>
</Grid>
</ListView.Header>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="15,10" HorizontalOptions="FillAndExpand">
<Label VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center"
Text="{Binding MenuTitle}"
d:Text="{Binding .}"
FontSize="20"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
Do you have example with dynamic FlyoutItems?
You can use FlyoutContentTemplate, by using it you are telling Shell to overwrite/replace whatever the Flyout content that was auto-generate based on your AppShell.xaml hierarchy by what you provide instead.
I guess by MenuItems you meant a list of flyout items.
<Shell Title="Shell Title" ...>
<Shell.FlyoutContentTemplate>
<DataTemplate>
<StackLayout>
<ListView x:Name="MenuItemsListView"
SeparatorVisibility="None"
HasUnevenRows="true"
ItemsSource="{Binding FlyoutItems}">
<ListView.Header>
<Grid BackgroundColor="#8f0000">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="80"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<Label Grid.Row="2" Grid.Column="1"
TextColor="#d7d9b4"
Text="{Binding Title}"
FontSize="24"/>
</Grid>
</ListView.Header>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="15,10"
HorizontalOptions="FillAndExpand">
<Label VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center"
Text="{Binding MenuTitle}"
TextColor="Black"
FontSize="20"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</DataTemplate>
</Shell.FlyoutContentTemplate>
Sample code
public ObservableCollection<dynamic> FlyoutItems { get; set; }
public AppShell()
{
FlyoutItems = new ObservableCollection<dynamic>()
{
new { MenuTitle="MenuTitle1" },
new { MenuTitle="MenuTitle2" },
new { MenuTitle="MenuTitle3" },
new { MenuTitle="MenuTitle4" }
};
InitializeComponent();
BindingContext = this;
}
It is only a sample to show the idea, not sure about your data design, but maybe it is better to use FlyoutContentTemplate with an ObservableCollection of your Items and MenuItemTemplate to a separate list of Menus item.
I have my view that when I open the keyboard of my cell phone it totally moves with everything and my top bar, what I need from my app that contains a chat is that the top bar is fixed and that only when the keyboard is opened do the messages move.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:common="clr-namespace:HomieApp.Views.Common;assembly=HomieApp"
xmlns:app="clr-namespace:HomieApp;assembly=HomieApp"
xmlns:helpers="clr-namespace:HomieApp.Helpers;assembly=HomieApp"
xmlns:forms="clr-namespace:Lottie.Forms;assembly=Lottie.Forms"
x:Class="HomieApp.Views.Servicio.ChatPage">
<ContentPage.Resources>
<ResourceDictionary>
<DataTemplate x:Key="leftChatTemplate">
<ViewCell>
<common:ChatLeftMessageItemTemplate />
</ViewCell>
</DataTemplate>
<DataTemplate x:Key="rightChatTemplate">
<ViewCell>
<common:ChatRightMessageItemTemplate />
</ViewCell>
</DataTemplate>
<helpers:ChatDataTemplateSelector x:Key="chatDataTemplateSelector"
LeftChatTemplate="{StaticResource leftChatTemplate}"
RightChatTemplate="{StaticResource rightChatTemplate}" />
</ResourceDictionary>
</ContentPage.Resources>
<Grid RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<common:MainLabelNavigation
Grid.Row="0"
HorizontalOptions="FillAndExpand"
x:Name="bar"
IsVisibleMenu="True"
Clicked="Bar_OnClicked"></common:MainLabelNavigation>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ListView
x:Name="ListViewMensajes"
Grid.Row="1"
ItemsSource="{Binding Mensajes}"
SeparatorVisibility="None"
SeparatorColor="Transparent"
HasUnevenRows="True"
ItemTapped="OnItemTapped"
ItemTemplate="{StaticResource chatDataTemplateSelector}">
</ListView>
<!--- BUTTONS CONTAINER -->
<Grid
x:Name="ContainerSend"
Grid.Row="2"
ColumnSpacing="5"
Padding="0"
MinimumHeightRequest="40">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="55"/>
</Grid.RowDefinitions>
<app:GradientButton Grid.Row="0" Grid.Column="0"
Margin="0,0,0,0"
VerticalOptions="End"
HorizontalOptions="FillAndExpand"
Command="{Binding EnviarVideoCommand}"
ButtonType="Gray"
Text="Tomar Video"/>
<app:GradientButton Grid.Row="0" Grid.Column="1"
Margin="0,0,0,0"
VerticalOptions="End"
HorizontalOptions="FillAndExpand"
Command="{Binding EnviarImagenCommand}"
ButtonType="Gray"
Text="Tomar Foto"/>
<StackLayout Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
Margin="0,0,0,15"
BackgroundColor="{ DynamicResource TranslucidOrange }"
Orientation="Horizontal">
<!--- ENTRY -->
<Entry
HorizontalOptions="FillAndExpand"
FontSize="14"
Placeholder="Escribe tu mensaje..."
Text="{Binding Path=Mensaje, Mode=TwoWay}"/>
<!--- SEND BUTTON -->
<app:FontAwesomeIcon
x:Name="SendButton"
HorizontalOptions="End"
Margin="10,0"
Text="{ x:Static app:Icon.FAPlay }"
FontSize="20"
TextColor="{StaticResource BorderTextColor}"
Style="{ StaticResource FontIcon }"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"/>
</StackLayout>
</Grid>
<app:CustomActivityIndicator
IsVisible="{Binding IsLoading}"
Grid.Row="0" Grid.RowSpan="3"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>
</Grid>
</Grid>
</ContentPage>
I already try changing the views in various ways, but since I am new to the development of applications in Xamarin I still do not understand or understand the view they handle very well.
I'm developing an app for my Bachelor's degree for creating and managing archaeological Field Guides. One functionality should enable the user to create new Field Guides in-app. A Field guide should consist of general infos (title, author, etc.) and multiple entries for artifact-types.
I want to realize that by having one ContentPage with two views - one for the book-info, one for a list of entries. The user should be able to switch between the two views.
To achieve that I created both as ContentViews, included them into the Parent-XAML and bound their IsVisible-attributes to individual booleans in the ViewModel. Strangely "NewBookInfo" throws an exeption on initialization, while "NewBookEntryList" works just fine. I couldn't find a solution on google and am kinda grasping at straws right now...
<ColumnDefinition Width="100/3*" /> results in runtime exception in InitializeComponent():
System.FormatException
Message=One of the identified items was in an invalid format.
Source=Xamarin.Forms.Core
StackTrace:
at Xamarin.Forms.GridLengthTypeConverter.ConvertFromInvariantString(String value)
...
My Parent-Page:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:FieldGuide.Views"
x:Class="FieldGuide.AddBook">
<StackLayout Spacing="1" VerticalOptions="Fill">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Text="New Guide" FontAttributes="Bold" FontSize="30"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand"
Grid.Row="0" Grid.Column="0" />
<ImageButton Source="Return_klein.png" Grid.Row="0" Grid.Column="1" Command="{Binding ReturnCommand}"/>
<ImageButton Source="Hamburger_Icon_klein.png" Grid.Row="0" Grid.Column="2" Command="{Binding MenuCommand}"/>
</Grid>
<!--BackgroundColor="Transparent" bei Buttons einfügen-->
<local:NewBookInfo VerticalOptions="FillAndExpand" IsVisible="{Binding BookInfoVisible}"/>
<local:NewBookEntryList VerticalOptions="FillAndExpand" IsVisible="{Binding BookEntriesVisible}"/>
</StackLayout>
</ContentPage>
NewBookInfo.xaml
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="FieldGuide.Views.NewBookInfo">
<ContentView.Content>
<StackLayout>
<Grid Margin="10, 10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30*"/>
<ColumnDefinition Width="70*"/>
</Grid.ColumnDefinitions>
<Label Text="Title" FontSize="20"
HorizontalOptions="Center" VerticalOptions="CenterAndExpand"
Grid.Row="0" Grid.Column="0"/>
<Label Text="Author" FontSize="20"
HorizontalOptions="Center" VerticalOptions="CenterAndExpand"
Grid.Row="1" Grid.Column="0"/>
<Label Text="Tags" FontSize="20"
HorizontalOptions="Center" VerticalOptions="CenterAndExpand"
Grid.Row="2" Grid.Column="0"/>
<Entry Grid.Row="0" Grid.Column="1"/>
<Entry Grid.Row="1" Grid.Column="1"/>
<Entry Placeholder="Separate with Comma" Grid.Row="2" Grid.Column="1"/>
</Grid>
<Grid VerticalOptions="EndAndExpand" Margin="10, 10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100/3*"/>
<ColumnDefinition Width="100/3*"/>
<ColumnDefinition Width="100/3*"/>
</Grid.ColumnDefinitions>
<Button Text="Save" Grid.Row="0" Grid.Column="0"
Command="{Binding SaveBook}"/>
<Button Text="Entries" Grid.Row="0" Grid.Column="1"
Command="{Binding NewEntry}"/>
<Button Text="Discard" Grid.Row="0" Grid.Column="2"
Command="{Binding DiscardBook}"/>
</Grid>
</StackLayout>
</ContentView.Content>
</ContentView>
For comparison NewBookEntryList.xaml (ListView is not yet finished)
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="FieldGuide.Views.NewBookEntryList">
<ContentView.Content>
<StackLayout>
<ListView x:Name="FileSystem" ItemsSource="{Binding Entries}" SelectedItem="{Binding SelectedEntry}" VerticalOptions="FillAndExpand">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Text="{Binding Name}" Margin="10" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="StartAndExpand"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Grid VerticalOptions="EndAndExpand" Margin="10, 10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*"/>
<ColumnDefinition Width="50*"/>
</Grid.ColumnDefinitions>
<Button Text="Book Info" Grid.Row="0" Grid.Column="0"
Command="{Binding SaveBook}"/>
<Button Text="New Entry" Grid.Row="0" Grid.Column="1"
Command="{Binding NewEntry}"/>
</Grid>
</StackLayout>
</ContentView.Content>
</ContentView>
This is how I wish it to be in the end.
The problem was in the width-declaration of the last grid in NewBookInfo.xaml.But the error wasn't flagged by the built-in error-detection in VS.
Instead of
<ColumnDefinition Width="100/3*"/>
I just replaced it with
<ColumnDefinition Width="33*"/>
Thanks to #Jason, for providing help in the comments.
Hello I have this layout where I have a picture of a body and by its side I have some buttons with some of the parts of the body(e.g, Head,arms,legs) but I'm having trouble fixing the buttons on the same row as the picture. The buttons stay as the same size as the picture what I wanna do is have the buttons on the side of the pic, like in the example.
I don't know if another kind of layout is more appropriate for this situtation.
here is my code:
<ContentPage.Content>
<StackLayout>
<Grid VerticalOptions="StartAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/> <!--coluna 0-->
<ColumnDefinition Width="20*"/> <!--coluna 1-->
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="50*"/> <!--linha 1-->
<RowDefinition Height="20*"/> <!--linha 2-->
<RowDefinition Height="20*"/> <!--linha 3-->
</Grid.RowDefinitions>
<Image Grid.Row="0" Grid.Column="0" Source="corpo_cortado.png"/>
<Button Text="Cabeça" Grid.Row="0" Grid.Column="1" />
<Button Text="Torso" Grid.Row="2" Grid.Column="1" />
</Grid>
</StackLayout>
</ContentPage.Content>
Thank you!
correct result:
From the comments I managed to make it work. What I did was. I created two stack Layout with vertical orientation and put each one in one column.Here some sample:
<StackLayout>
<Grid VerticalOptions="StartAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/> <!--coluna 0-->
<ColumnDefinition Width="20*"/> <!--coluna 1-->
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="50*"/> <!--linha 1-->
<RowDefinition Height="20*"/> <!--linha 2-->
<RowDefinition Height="20*"/> <!--linha 3-->
</Grid.RowDefinitions>
<StackLayout Orientation="Vertical" Grid.Row="0" Grid.Column="0">
<Image Grid.Row="0" Grid.Column="0" Source="corpo_cortado.png"/>
</StackLayout>
<StackLayout Orientation="Vertical" Grid.Row="0" Grid.Column="1">
<Button Text="Cabeça" Grid.Row="0" Grid.Column="1" Clicked="Button_Clicked"/>
</StackLayout>
</Grid>
</StackLayout>
For Grid Row-0, Column-1, take a Stack Layout with vertical orientation, and place two buttons inside that Stack Layout, that will place image for Row-0, Column-0 and buttons for Row-0, Column-1.
Still you need code for sample let me know.
Hope this may solve your issue.