How to create ScrollView in my layout - xamarin

I want my ScrollView to join my StackLayout and my list so I can scroll it down, an example I saw that worked out was the one below but I was not able to implement it at my command
The way it is now it's from a scrowview in the List
This example worked out
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
NavigationPage.TitleIcon="logoD">
<ScrollView>
<StackLayout x:Name="topo">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.RowSpan="2" Scale="1.0" Aspect="AspectFill" VerticalOptions="FillAndExpand" HeightRequest="250">
<Image.Source>
<UriImageSource Uri="{Binding img}" CacheValidity="5" CachingEnabled="True"/>
</Image.Source>
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="OnTapped" />
</Image.GestureRecognizers>
</Image>
</Grid>
</StackLayout>
<ListView x:Name="list" ItemsSource="{Binding list}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell >
<Grid Padding="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackLayout Grid.Column="2" Spacing="4" VerticalOptions="Center">
<Label Text="{Binding Categoria}" TextColor="#38B6AB" FontSize="Small" LineBreakMode="NoWrap"/>
<Label Text="{Binding Data}" TextColor="#666666" FontSize="Small" LineBreakMode="NoWrap"/>
<Label Text="{Binding hora}" TextColor="#474747" Font="Bold" FontSize="Small" LineBreakMode="WordWrap"/>
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollView>

You shouldn't put a ListView inside a ScrollView as they both implement scrolling. What you should do is use the Header template of the ListView to put your Grid there. That way it will scroll with the ListView.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
NavigationPage.TitleIcon="logoD">
<ListView x:Name="list" ItemsSource="{Binding list}">
<ListView.HeaderTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.RowSpan="2" Scale="1.0" Aspect="AspectFill" VerticalOptions="FillAndExpand" HeightRequest="250">
<Image.Source>
<UriImageSource Uri="{Binding img}" CacheValidity="5" CachingEnabled="True"/>
</Image.Source>
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="OnTapped" />
</Image.GestureRecognizers>
</Image>
</Grid>
</DataTemplate
</ListView.HeaderTemplate>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Padding="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackLayout Grid.Column="2" Spacing="4" VerticalOptions="Center">
<Label Text="{Binding Categoria}" TextColor="#38B6AB" FontSize="Small" LineBreakMode="NoWrap"/>
<Label Text="{Binding Data}" TextColor="#666666" FontSize="Small" LineBreakMode="NoWrap"/>
<Label Text="{Binding hora}" TextColor="#474747" Font="Bold" FontSize="Small" LineBreakMode="WordWrap"/>
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>

I was able to implement with this same example command
<ContentPage.Content>
<ListView ItemsSource="{Binding MonkeysGrouped}"
ItemTapped="Handle_ItemTapped"
ItemSelected="Handle_ItemSelected"
HasUnevenRows="true"
GroupShortNameBinding = "{Binding Key}"
IsGroupingEnabled = "true"
GroupDisplayBinding = "{Binding Key}">
<ListView.Header>
<cv:CarouselView x:Name="CarouselZoos" ItemsSource="{Binding Path=BindingContext.Zoos, Source={x:Reference MonkeysPage}}" HeightRequest="200">
<cv:CarouselView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.RowSpan="2" Aspect="AspectFill" Source="{Binding ImageUrl}"/>
<StackLayout Grid.Row="1" BackgroundColor="#80000000" Padding="12">
<Label TextColor="White" Text="{Binding Name}" FontSize="16" HorizontalOptions="Center" VerticalOptions="CenterAndExpand"/>
</StackLayout>
</Grid>
</DataTemplate>
</cv:CarouselView.ItemTemplate>
</cv:CarouselView>
</ListView.Header>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Padding="10" RowSpacing="10" ColumnSpacing="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<controls:CircleImage
BorderColor="Aqua"
BorderThickness="3"
HeightRequest="66"
HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand"
Aspect="AspectFill"
WidthRequest="66"
Grid.RowSpan="2"
Source="{Binding Image}"/>
<Label Grid.Column="1"
Text="{Binding Name}"
VerticalOptions="End"/>
<Label Grid.Column="1"
Grid.Row="1"
VerticalOptions="Start"
Text="{Binding Location}"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>

Related

Parts of UI vanishing when debugging xamarin project on own device

I am building an app, and the debugging works fine when I use the emulator and it all looks the way I want it to.
Because I am using a barcode scanner, I started debugging on my own android device instead, but then most of my UI in one of some of the pages vanishes. (see pics)
I can't find any similar problems when I google (although that might be my poor google skills).
Here is on my device when its all vanished
Here is what it is suppose to look like
<?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="TergeoAppUI.Views.RegisterInventoryPage"
xmlns:vm="clr-namespace:TergeoAppUI.ViewModels"
xmlns:ZXing="clr-namespace:ZXing.Net.Mobile.Forms;assembly=ZXing.Net.Mobile.Forms" xmlns:model="clr-namespace:Tergeo.Models;assembly=Tergeo.Models"
x:DataType="vm:RegisterInventoryViewModel"
Title="{Binding Title}">
<StackLayout>
<Grid Padding="0,5,0,0" ColumnSpacing="2">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button
ImageSource="barcode.png"
Text="Scanna"
BackgroundColor="#AAC0AA"
BorderColor="Black"
BorderWidth="3"
HeightRequest="200"
Grid.Row="1"
Grid.Column="2"
Grid.RowSpan="1"
Margin="70,10,10,10"
Command="{Binding GoToScanCommand}"
/>
<Entry
Grid.Row="1"
Grid.ColumnSpan="3"
Margin="20,30,160,5"
Placeholder="EAN, PLU..."
VerticalOptions="FillAndExpand"
Completed="{Binding OnEanEntryCompletionCommand}"
Text="{Binding Ean}"
Keyboard="Numeric"
/>
</Grid>
<Label Margin="30,2" FontSize="Medium" Text="{Binding ArticleName}"/>
<StackLayout HeightRequest="200">
<Grid Padding="2" VerticalOptions="Fill" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label
Grid.Row="1"
Margin="30,2"
FontSize="Medium"
Text="{Binding RetailPrice, StringFormat='Utpris: {0:N}'}"/>
<Entry
Placeholder="Antal"
Grid.Row="2"
Grid.ColumnSpan="2"
Grid.Column='0'
Margin="20,0,20,0"
FontSize="Medium"
Text="{Binding Quantity, StringFormat='Antal: {0:N}'}"/>
<Entry
Grid.ColumnSpan="2"
Margin="0,0,30,0"
Placeholder="Låda"
Grid.Row="2"
Grid.Column="2"
FontSize="Medium"
Text="{Binding Box, StringFormat='Låda: {0:S}'}"
Completed="{Binding OnRegistrationCompletedCommand}"/>
</Grid>
</StackLayout>
<!-- List with all the inventoryregistration for this specific list -->
<ListView
BackgroundColor="White"
ItemsSource="{Binding InventoryList}"
HasUnevenRows="True"
SelectionMode="None"
>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Padding="1" ColumnSpacing="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- ArticleName -->
<StackLayout
Padding="10,0"
x:DataType="model:InventoryInfoModel"
Grid.Column="0"
Grid.Row="0">
<Label
TextColor="Black"
FontFamily="PTC55F.ttf#ptc55f"
Text="{Binding ArticleName}"
FontSize="Small"/>
</StackLayout>
<!-- Article Supplier -->
<StackLayout
Padding="10,0"
x:DataType="model:InventoryInfoModel"
Grid.Column="1"
Grid.Row="0"
Grid.ColumnSpan="2">
<Label
TextColor="Black"
FontFamily="PTC55F.ttf#ptc55f"
Text="{Binding Supplier}"
FontSize="Small"/>
</StackLayout>
<!-- Article Ean -->
<StackLayout
Padding="10,0"
x:DataType="model:InventoryInfoModel"
Grid.Column="0"
Grid.Row="1">
<Label
FontFamily="PTC55F.ttf#ptc55f"
Margin="0,5,0,5"
Text="{Binding Ean}"
FontSize="Small"/>
</StackLayout>
<StackLayout
Padding="10,0"
x:DataType="model:InventoryInfoModel"
Grid.Column="0"
Grid.Row="1">
<Label
FontFamily="PTC55F.ttf#ptc55f"
Margin="0,5,0,5"
Text="{Binding Plu}"
FontSize="Small"/>
</StackLayout>
<StackLayout
Padding="10,0"
x:DataType="model:InventoryInfoModel"
Grid.Column="1"
Grid.Row="1"
Grid.ColumnSpan="2">
<Label
FontFamily="PTC55F.ttf#ptc55f"
Margin="0,5,0,5"
Text="{Binding Quantity, StringFormat='Antal: {0:N}'}"
FontSize="Small"/>
</StackLayout>
<StackLayout
Padding="10,0"
x:DataType="model:InventoryInfoModel"
Grid.Column="4"
Grid.Row="0"
Grid.ColumnSpan="2">
<Label
FontFamily="PTC55F.ttf#ptc55f"
Margin="0,5,0,5"
Text="{Binding Box, StringFormat='Låda: {0:S}'}"
FontSize="Small"/>
</StackLayout>
<StackLayout
Padding="10,0"
x:DataType="model:InventoryInfoModel"
Grid.Column="4"
Grid.Row="1"
Grid.ColumnSpan="2">
<Label
FontFamily="PTC55F.ttf#ptc55f"
Margin="0,5,0,5"
Text="{Binding StorageName, StringFormat='Hyllplats: {0:S}'}"
FontSize="Small"/>
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage>
Easy fix, apparently the default color on all text is white when you debug on an android device, so all I did was add PlaceholderColor or textcolor to all the labels/entries.

Xamarin The property 'Content' is set more than once

I have a problem. I want to make a custom header, so I created this stacklayout:
<StackLayout VerticalOptions="Start" HeightRequest="50" HorizontalOptions="CenterAndExpand">
<Image HorizontalOptions="Start" Source="Logo.png"/>
<Image HorizontalOptions="Start" Source="Title_Dark.png"/>
</StackLayout>
Now I want to put it above the following code:
<ContentPage.Content>
<ListView x:Name="ListViewMain" VerticalOptions="FillAndExpand" BackgroundColor="#212121" SelectionMode="None">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout>
<Label HeightRequest="1" BackgroundColor="#E3E3E3" />
<Grid x:Name="GridMain">
<Grid.RowDefinitions>
<RowDefinition Height="40" x:Name="Row0_Height"/>
<RowDefinition Height="180" x:Name="Row1_Height"/>
<RowDefinition Height="180" x:Name="Row2_Height"/>
<RowDefinition Height="40" x:Name="Row3_Height"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40" x:Name="Column0_Width" />
<ColumnDefinition Width="*" x:Name="Column1_Width" />
<ColumnDefinition Width="40" x:Name="Column2_Width" />
</Grid.ColumnDefinitions>
<Label Text="{Binding Creator}" TextColor="White" FontSize="Body" FontAttributes="Bold" Grid.Column="1" Grid.Row="0" VerticalOptions="Center" HorizontalOptions="Start"/>
<Image Source="VoteUp.png" VerticalOptions="End" HorizontalOptions="Center" Grid.Row="1" Grid.Column="0">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="imgVoteUp_Clicked" />
</Image.GestureRecognizers>
</Image>
<Image Source="VoteDown.png" VerticalOptions="Start" HorizontalOptions="Center" Grid.Row="2" Grid.Column="0">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="imgVoteDown_Clicked" />
</Image.GestureRecognizers>
</Image>
<Image Source="{Binding ImageLocation}" Margin="0, 0, 20, 0" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Grid.RowSpan="2" BackgroundColor="AliceBlue" VerticalOptions="Fill" HorizontalOptions="Fill"/>
<Image Source="Favorite.png" Grid.Row="3" Grid.Column="1" HorizontalOptions="Start">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="imgFavorite_Clicked" />
</Image.GestureRecognizers>
</Image>
<Image Source="Send_Dark.png" Grid.Row="3" Grid.Column="1" HorizontalOptions="End"/>
<Image Source="Save_Dark.png" Grid.Row="3" Grid.Column="2" HorizontalOptions="End"/>
</Grid>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage.Content>
But when I put it right under the <ContentPage.Content> tag, it gives the following error:
The property 'Content' is set more than once
When I put it above the <ContentPage.Content> tag, my whole screen is the header.
How can I fix this?
Content can only have ONE child element. If you want to have multiple child elements, you need to place them inside of a layout container (Grid, StackLayout, etc)

Xamarin Add dividing line into Grid

I have a problem. I want created this ListView using the following code:
<?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:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="MyApp.HomePage">
<ContentPage.Content>
<ListView x:Name="ListViewMain" VerticalOptions="FillAndExpand" BackgroundColor="#212121" SelectionMode="None">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid x:Name="GridMain">
<Grid.RowDefinitions>
<RowDefinition Height="40" x:Name="Row0_Height"/>
<RowDefinition Height="180" x:Name="Row1_Height"/>
<RowDefinition Height="180" x:Name="Row2_Height"/>
<RowDefinition Height="40" x:Name="Row3_Height"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40" x:Name="Column0_Width" />
<ColumnDefinition Width="*" x:Name="Column1_Width" />
<ColumnDefinition Width="40" x:Name="Column2_Width" />
</Grid.ColumnDefinitions>
<Label Text="{Binding Creator}" TextColor="White" FontSize="Body" FontAttributes="Bold" Grid.Column="1" Grid.Row="0" VerticalOptions="Center" HorizontalOptions="Start"/>
<Image Source="VoteUp.png" VerticalOptions="End" HorizontalOptions="Center" Grid.Row="1" Grid.Column="0">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="imgVoteUp_Clicked" />
</Image.GestureRecognizers>
</Image>
<Image Source="VoteDown.png" VerticalOptions="Start" HorizontalOptions="Center" Grid.Row="2" Grid.Column="0">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="imgVoteDown_Clicked" />
</Image.GestureRecognizers>
</Image>
<Image Source="{Binding ImageLocation}" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Grid.RowSpan="2" BackgroundColor="AliceBlue" VerticalOptions="Fill" HorizontalOptions="Fill"/>
<Image Source="Favorite.png" Grid.Row="3" Grid.Column="1" HorizontalOptions="Start">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="imgFavorite_Clicked" />
</Image.GestureRecognizers>
</Image>
<Image Source="Send_Dark.png" Grid.Row="3" Grid.Column="1" HorizontalOptions="End"/>
<Image Source="Save_Dark.png" Grid.Row="3" Grid.Column="2" HorizontalOptions="End"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage.Content>
</ContentPage>
But now I want to add a line above the first Label tag. To create the line I want I use this code:
<Label HeightRequest="1" BackgroundColor="#E3E3E3" />
But I don't know where to put it and how, because it is a Grid. I want to add it before the Grid, but that gives me the error:
The property 'View' is set more than once.
What am I doing wrong and how can I fix this?
I would use a BoxView instead of a Label. You could use this layout, placing the BoxView in the same Row as the Label, but vertically aligned
the other things you could try
add another row to the Grid for the BoxView
place the Grid inside of a StackLayout with the BoxView

xamarin Forms scrollview

I am trying to create a page in Xamarin forms with two columns and five rows.
Both the columns have images with a label at the bottom and a white background. The image and label need to be in the same stack layout.
Basically each stack layout is a thumbnail redirecting to other pages.
Here is what I've tried:
<ScrollView>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="0" Grid.Row="0">
<Image Source="My_concern.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Raise A Concern"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="1" Grid.Row="0">
<Image Source="img_leave_plan.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Leave Plan" ></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="0" Grid.Row="1">
<Image Source="My_Checklist.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Leave Plan"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="1" Grid.Row="1">
<Image Source="img_facilities.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Facilities"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="0" Grid.Row="2">
<Image Source="My_buddies.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="My Buddies"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="1" Grid.Row="2">
<Image Source="SapphireArticles.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Articles"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="0" Grid.Row="3">
<Image Source="policy.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Policies"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="1" Grid.Row="3">
<Image Source="SapphireNews.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="News"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="1" Grid.Row="4">
<Image Source="Compass.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Compass"></Label>
</StackLayout>
</StackLayout>
</Grid>
</ScrollView>
I am getting the error
No property, bindable property, or event found for 'Children'.
What am I doing wrong?
Your stacklayout that is the direct child of grid does not have row or column specified. You are specifying it at a level deeper in which grid is not the parent.
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="0" Grid.Row="0">
Also the layout does not looks optimal. You may want to think about refactoring this.
Code without the extra stack layout :
<ScrollView>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackLayout BackgroundColor="White" Grid.Column="0" Grid.Row="0">
<Image Source="My_concern.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Raise A Concern"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="1" Grid.Row="0">
<Image Source="img_leave_plan.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Leave Plan" ></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="0" Grid.Row="1">
<Image Source="My_Checklist.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Leave Plan"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="1" Grid.Row="1">
<Image Source="img_facilities.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Facilities"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="0" Grid.Row="2">
<Image Source="My_buddies.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="My Buddies"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="1" Grid.Row="2">
<Image Source="SapphireArticles.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Articles"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="0" Grid.Row="3">
<Image Source="policy.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Policies"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="1" Grid.Row="3">
<Image Source="SapphireNews.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="News"></Label>
</StackLayout>
<StackLayout BackgroundColor="White" Grid.Column="1" Grid.Row="4">
<Image Source="Compass.png" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"></Image>
<Label Text="Compass"></Label>
</StackLayout>
</Grid>
</ScrollView>

Keyboard kneaded my layout in xamarin forms

When I click in a entry and the keyboard is oppened, all my layout is kneaded.
Like in the photos.
Before :
After:
This happend with my android and ios devices
I am using xamarin forms...does someone know how to solve that?
My xaml where only put the scroll view doesn't work:
<ScrollView BackgroundColor="Red">
<Grid RowSpacing="0" HeightRequest="100">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="9*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2.3*"/>
<RowDefinition Height="5.4*"/>
<RowDefinition Height="2.3*"/>
</Grid.RowDefinitions>
<Image Source="recuperarFundo" Grid.Column="1" Grid.Row="1" Aspect="Fill" HorizontalOptions="FillAndExpand"/>
<Grid Grid.Column="1" Grid.Row="1" RowSpacing="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="3*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="3*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" VerticalOptions="CenterAndExpand">
<Image Source="cadastrarVoltar" Margin="20,0,0,0" Grid.Column="0" Grid.Row="0" VerticalOptions="Start" HorizontalOptions="Start">
<!--<Image.Margin>
<OnPlatform x:TypeArguments="Thickness"
Android="20,0,0,0"
iOS="20,0,0,0"/>
</Image.Margin>-->
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="OnClose"/>
</Image.GestureRecognizers>
</Image>
<Image Source="loginlogo" Margin="0,10,0,10" Grid.Column="0" Grid.Row="0" VerticalOptions="Center" HorizontalOptions="Center"/>
</Grid>
<Grid Grid.Row="1" VerticalOptions="CenterAndExpand">
<Image Source="recuperarForms" Aspect="Fill" Grid.Column="0" Grid.Row="0" Margin="20,0,20,0"/>
<Grid Grid.Column="0" Grid.Row="0" RowSpacing="0" Padding="25,0,25,0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="5*"/>
<RowDefinition Height="5*"/>
</Grid.RowDefinitions>
<local:MyLabel x:Name="recupera_lbl" Text="Para recuperar sua senha, digite abaixo o e-mail cadastrado" Margin ="20,0,20,0" VerticalOptions="CenterAndExpand" HorizontalTextAlignment="Center" HorizontalOptions="CenterAndExpand" NamedFontSize="Small" Style="{Binding labelsfont}"/>
<local:MyEntry x:Name="recuperar_entry" Grid.Row="1" VerticalOptions="Center" Placeholder="Seu e-mail" TextColor="{StaticResource MarromClaro}" PlaceholderColor="{StaticResource MarromClaro}" FontSize="Small" HorizontalOptions="Fill" HorizontalTextAlignment="Center"/>
</Grid>
</Grid>
<Grid Grid.Row="2" VerticalOptions="FillAndExpand">
<ActivityIndicator Grid.Row="0" Grid.Column ="0" x:Name="recuperar_indicator" Color="DarkRed" HorizontalOptions="CenterAndExpand" IsVisible="false" IsRunning="true"/>
<Image Grid.Row="0" Grid.Column ="0" x:Name="recuperar_button" Source="recuperarButton" HorizontalOptions="CenterAndExpand">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="CallingRecuperarSenhaAsync"/>
</Image.GestureRecognizers>
</Image>
</Grid>
</Grid>
</Grid>
use ScrollView as main container

Resources