Keyboard overlapping the entry fields - xamarin

i have a view which contains entry fields kept inside the scrollView,here when i tapped on entry field the keyboard popups and covers the remaining fields,by following this i couldnt able to solve my problem.i chnged my main activity as [Activity(Label = "MyApp", Icon = "#drawable/icon", Theme = "#style/MainTheme", MainLauncher = false, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, WindowSoftInputMode = SoftInput.AdjustResize)] and also checked for AdjustPan nothing worked,how to scroll those fields upto last field when keyboardpopups?
<ContentView>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ScrollView Orientation="Vertical">
<StackLayout Grid.Row="0" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand" Padding="10">
<StackLayout.Spacing>
<OnIdiom x:TypeArguments ="x:Double" Phone = "8" Tablet ="16"/>
</StackLayout.Spacing>
<Entry x:Name="FirstNameEntry" PlaceholderColor="#9E9E9E" Text="{Binding FirstName}" Placeholder="First name" HorizontalOptions="FillAndExpand" TextColor="#191919" FontFamily="Avenir Book">
<Entry.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="30" Android="40" WinPhone="28" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" WinPhone="28" />
</OnIdiom.Tablet>
</OnIdiom>
</Entry.HeightRequest>
</Entry>
<Entry x:Name="LastNameEntry" Text="{Binding LastName}" PlaceholderColor = "#9E9E9E" Placeholder="Last name" HorizontalOptions="FillAndExpand" TextColor="#191919" FontFamily="Avenir Book">
<Entry.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="30" Android="40" WinPhone="28" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" WinPhone="28" />
</OnIdiom.Tablet>
</OnIdiom>
</Entry.HeightRequest>
</Entry>
<Entry x:Name="MobileNameEntry" Keyboard="Numeric" PlaceholderColor="#9E9E9E" Text="{Binding MobileNumber}" TextChanged = "On_PhoneNumberTextChanged" Placeholder="Mobile number" HorizontalOptions="FillAndExpand" TextColor="#191919" FontFamily="Avenir Book">
<Entry.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="30" Android="40" WinPhone="28" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" WinPhone="28" />
</OnIdiom.Tablet>
</OnIdiom>
</Entry.HeightRequest>
</Entry>
<Entry x:Name="HouseNumberEntry" Text="{Binding HouseNumber}" PlaceholderColor="#9E9E9E" Placeholder="House number" HorizontalOptions="FillAndExpand" TextColor="#191919" FontFamily="Avenir Book">
<Entry.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="30" Android="40" WinPhone="28" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" WinPhone="28" />
</OnIdiom.Tablet>
</OnIdiom>
</Entry.HeightRequest>
</Entry>
<Entry x:Name="StreetNameEntry" Text="{Binding StreetName}" PlaceholderColor="#9E9E9E" Placeholder="Street name" HorizontalOptions="FillAndExpand" TextColor="#191919" FontFamily="Avenir Book">
<Entry.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="30" Android="40" WinPhone="28" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" WinPhone="28" />
</OnIdiom.Tablet>
</OnIdiom>
</Entry.HeightRequest>
</Entry>
<Entry x:Name="CityNameEntry" Text="{Binding City}" PlaceholderColor="#9E9E9E" Placeholder="City" HorizontalOptions="FillAndExpand" TextColor="#191919" FontFamily="Avenir Book">
<Entry.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="30" Android="40" WinPhone="28" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" WinPhone="28" />
</OnIdiom.Tablet>
</OnIdiom>
</Entry.HeightRequest>
</Entry>
<Entry x:Name="PostCodeEntry" Text="{Binding PostalCode}" PlaceholderColor="#9E9E9E" Placeholder="Post code" HorizontalOptions="FillAndExpand" TextColor="#191919" FontFamily="Avenir Book">
<Entry.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="30" Android="40" WinPhone="28" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" WinPhone="28" />
</OnIdiom.Tablet>
</OnIdiom>
</Entry.HeightRequest>
</Entry>
<Picker x:Name="AddressTypePicker" Title="Select type" HorizontalOptions="FillAndExpand" SelectedIndexChanged="AddressTypePicker_OnSelectedIndexChanged">
<Picker.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="30" Android="40" WinPhone="28" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="45" WinPhone="28" />
</OnIdiom.Tablet>
</OnIdiom>
</Picker.HeightRequest>
</Picker>
</StackLayout>
</ScrollView>
<StackLayout BackgroundColor="#f2c646" Grid.Row="1" Orientation="Horizontal" HorizontalOptions="FillAndExpand" VerticalOptions="End" Padding="0">
<StackLayout.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="50" WinPhone="28" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="50" Android="60" WinPhone="28" />
</OnIdiom.Tablet>
</OnIdiom>
</StackLayout.HeightRequest>
<StackLayout Padding="10">
<Label Text="Cancel" TextColor="Black" HorizontalOptions="StartAndExpand" FontFamily="Avenir Book" VerticalTextAlignment="Center">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="OnCancelBtnClicked"/>
</Label.GestureRecognizers>
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="15" Android="17" WinPhone="28" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="20" Android="22" WinPhone="28" />
</OnIdiom.Tablet>
</OnIdiom>
</Label.FontSize>
</Label>
</StackLayout>
<StackLayout HorizontalOptions="EndAndExpand" Padding="10">
<Label Text="Save" TextColor="Black" VerticalTextAlignment="Center" FontFamily="Avenir Book">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding SaveCommand}"/>
</Label.GestureRecognizers>
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="15" Android="17" WinPhone="28" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="20" Android="22" WinPhone="28" />
</OnIdiom.Tablet>
</OnIdiom>
</Label.FontSize>
</Label>
</StackLayout>
</StackLayout>
</Grid>

I believe you have a situation of signup form. Why don't you use tableview with Intent="Form" as table view has a built-in scroller which can accommodate for keep-entry-in-view behaviour. It gives native look of a form as well.
I used it in one of my projects and it worked perfectly on both iOS and Android.
<TableView Intent="Form" HasUnevenRows="true">
</TableView>
Reference: TableView
Hope this helps

Related

Xamarin forms shell navigation flickering

I have a xamarin.forms app in which I am using shell. The problem I am facing is when I navigate from shell bottom navigation to any inner page and navigate back to previous page there is a flicker occurring.Please refer the screen record https://drive.google.com/open?id=1861iNlcV7ao6oDUNu7nL4WiyFuWjwXx_.
My Shell Page
<Shell 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"
Shell.NavBarIsVisible="False"
xmlns:local="clr-namespace:PaTS.Views"
x:Class="SampleApp.AppShell">
<TabBar>
<Tab Title="Dashboard" Icon="icon_dashboard.png" >
<ShellContent ContentTemplate="{DataTemplate local:Dashboard}" />
</Tab>
<Tab Title="Notifications" Icon="icon_notifications.png">
<ShellContent ContentTemplate="{DataTemplate local:Dashboard}" />
</Tab>
<Tab Title="Account" Icon="icon_user.png">
<ShellContent ContentTemplate="{DataTemplate local:Dashboard}" />
</Tab>
</TabBar>
</Shell>
Dashboard 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:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:ImageCircle.Forms.Plugin.Abstractions;assembly=ImageCircle.Forms.Plugin"
xmlns:local="clr-namespace:sample.CustomRender"
mc:Ignorable="d"
BackgroundColor="#004d6f"
Title="Dashboard"
x:Class="sample.Views.Dashboard">
<ContentPage.Content>
<Grid>
<!--<Image Aspect="AspectFill" >
<Image.Source>
<OnIdiom x:TypeArguments="FileImageSource" Tablet="cover.jpg" Phone="loginbackground_phone.jpg" />
</Image.Source>
</Image>-->
<Grid >
<Grid.RowDefinitions >
<RowDefinition Height="0.9*"/>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" BackgroundColor="#004d6f">
<StackLayout BackgroundColor="Transparent" IsClippedToBounds="True" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" >
<Grid HorizontalOptions="Start" VerticalOptions="Center">
<controls:CircleImage
BorderColor="LightBlue"
BorderThickness="2"
Source="sampleuser.png"
Aspect="AspectFill">
<Image.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS" Value="20,30,15,0" />
<On Platform="Android" Value="20,15,15,0" />
</OnPlatform>
</Image.Margin>
<Image.HeightRequest>
<OnIdiom x:TypeArguments="x:Double" Tablet="60" Phone="30" />
</Image.HeightRequest>
</controls:CircleImage>
<controls:CircleImage
x:Name="UserImage"
BorderColor="LightBlue"
BorderThickness="2"
Source="sampleuser.png"
Aspect="AspectFill">
<Image.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS" Value="20,30,15,0" />
<On Platform="Android" Value="20,15,15,0" />
</OnPlatform>
</Image.Margin>
<Image.HeightRequest>
<OnIdiom x:TypeArguments="x:Double" Tablet="60" Phone="30" />
</Image.HeightRequest>
</controls:CircleImage>
</Grid>
<Label Text="Welcome" HorizontalOptions="Start" VerticalOptions="Center" MaxLines="1" TextColor="White">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Regular" />
<On Platform="Android" Value="Montserrat-Regular.ttf#Montserrat-Regular" />
</OnPlatform>
</Label.FontFamily>
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double" Tablet="14" Phone="11" />
</Label.FontSize>
<Label.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS" Value="0,30,0,0" />
<On Platform="Android" Value="0,15,0,0" />
</OnPlatform>
</Label.Margin>
</Label>
<Label x:Name="UserName" MaxLines="1" Text="User" HorizontalOptions="Start" VerticalOptions="Center" TextColor="LightBlue">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Regular" />
<On Platform="Android" Value="Montserrat-Regular.ttf#Montserrat-Regular" />
</OnPlatform>
</Label.FontFamily>
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double" Tablet="14" Phone="11" />
</Label.FontSize>
<Label.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS" Value="0,30,0,0" />
<On Platform="Android" Value="0,15,0,0" />
</OnPlatform>
</Label.Margin>
</Label>
</StackLayout>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="150"/>
<RowDefinition Height="50"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="icon_xamarin_logo.png" HorizontalOptions="CenterAndExpand" Margin="0,25,0,0">
</Image>
<Label Grid.Row="1" Text="Sample App" TextColor="White" FontSize="30" Margin="10,5,10,5" HorizontalTextAlignment="Center" >
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Bold" />
<On Platform="Android" Value="Montserrat-Bold.ttf#Montserrat-Bold" />
</OnPlatform>
</Label.FontFamily>
</Label>
<Label Grid.Row="2" Text="Sample app details™" TextColor="Snow" FontSize="Medium" Margin="10,5,10,10" HorizontalTextAlignment="Center" >
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Regular" />
<On Platform="Android" Value="Montserrat-Regular.ttf#Montserrat-Regular" />
</OnPlatform>
</Label.FontFamily>
</Label>
</Grid>
</StackLayout>
</Grid>
<Image Grid.Row="1" HorizontalOptions="FillAndExpand" Aspect="AspectFill" Source="CurvedMask.jpg" Margin="-6,0,-6,-6"></Image>
<StackLayout Grid.Row="2" BackgroundColor="White">
<Frame HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="Transparent" Margin="15">
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Frame Grid.Row="0" Grid.Column="0" CornerRadius="6">
<Frame.GestureRecognizers>
<TapGestureRecognizer
Tapped="Timesheet_Tapped"
NumberOfTapsRequired="1" />
</Frame.GestureRecognizers>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Source="icon_timesheet.png" Grid.Row="0"></Image>
<Label Text="Timesheets" Grid.Row="1" HorizontalTextAlignment="Center" TextColor="Gray">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Bold" />
<On Platform="Android" Value="Montserrat-Bold.ttf#Montserrat-Bold" />
</OnPlatform>
</Label.FontFamily>
</Label>
</Grid>
</Frame>
<Frame Grid.Row="0" Grid.Column="2" CornerRadius="6">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Source="icon_employee.png" Grid.Row="0"></Image>
<Label Text="Employees" Grid.Row="1" HorizontalTextAlignment="Center" TextColor="Gray">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Bold" />
<On Platform="Android" Value="Montserrat-Bold.ttf#Montserrat-Bold" />
</OnPlatform>
</Label.FontFamily>
</Label>
</Grid>
</Frame>
<Frame Grid.Row="1" Grid.Column="0" CornerRadius="6">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Source="icon_graph.png" Grid.Row="0"></Image>
<Label Text="Analysis" Grid.Row="1" HorizontalTextAlignment="Center" TextColor="Gray">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Bold" />
<On Platform="Android" Value="Montserrat-Bold.ttf#Montserrat-Bold" />
</OnPlatform>
</Label.FontFamily>
</Label>
</Grid>
</Frame>
<Frame Grid.Row="1" Grid.Column="2" CornerRadius="6">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Source="icon_info.png" Grid.Row="0"></Image>
<Label Text="Info" Grid.Row="1" HorizontalTextAlignment="Center" TextColor="Gray">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Bold" />
<On Platform="Android" Value="Montserrat-Bold.ttf#Montserrat-Bold" />
</OnPlatform>
</Label.FontFamily>
</Label>
</Grid>
</Frame>
</Grid>
</Frame>
</StackLayout>
</Grid>
</Grid>
</ContentPage.Content>
</ContentPage>
Page navigation
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Dashboard : ContentPage
{
public Dashboard()
{
InitializeComponent();
}
private async void Timesheet_Tapped(object sender, EventArgs e)
{
await Navigation.PushAsync(new TimesheetList(),true);
}
}
When I navigate to TimesheetList and press back button, It will slide back to dashboard with little flicker. How to resolve this? Any help is appreciated.
I test the code you provided. In the Dashboard page, there is no code you used to for Timesheet_Tapped event.
Try the code below, it works well on my side.
<Image Source="icon_timesheet.png" Grid.Row="0" >
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="Timesheet_Tapped"></TapGestureRecognizer>
</Image.GestureRecognizers>
</Image>
I have the same issue, but in the android emulator Android 9.0 fickering not happend, in my case only Samsung s8, s8+, s9, s9+, s10, s10+ devices.
In this bug report:
https://github.com/xamarin/Xamarin.Forms/issues/8581
That guy finds a workaround, delete animation:
protected override bool OnBackButtonPressed() {
Current.Navigation.PopAsync(false);
return true;
}

Application is crashed due to Xamarin.CarouselView in xamarin android project

I have very tied to find out the reason of unexpectedly closing of my xamarin android project. I have used CarouselView in xaml page. When I am navigate to that page application is crashed unexpectedly but it works fine when I run ios project. Actually I am working on portable project. Can you please suggest any idea of this issue. I have posted the my hockeyapp crash report. I think it will help to identify, what the exact cause.Thanks in advance.
Here is hockey app crash report
Here is my code
<cv:CarouselView VerticalOptions = "FillAndExpand" HorizontalOptions =
"FillAndExpand" Position = "{Binding DishCategory}" ItemSelected =
"OnSwipeDishesHandler" ItemsSource = "{Binding RestaurantDishesList}"
x:Name = "RestaurantDishesList">
<cv:CarouselView.HeightRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="230" Tablet ="630"/>
</cv:CarouselView.HeightRequest>
<cv:CarouselView.ItemTemplate>
<DataTemplate>
<StackLayout Padding = "10,5,10,5" Orientation = "Vertical">
<ListView x:Name="RestaurantMenuListView" BackgroundColor="Transparent" ItemsSource="{Binding CategoryWiseDishes}" HasUnevenRows="true" SeparatorColor="#eeeeee" ItemTapped="OnItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="7">
<Grid Padding="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackLayout Grid.Column="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="OnMenuItemSelected"/>
</StackLayout.GestureRecognizers>
<Label Text="{Binding Name}" TextColor="Black">
<Label.FontSize>
<OnIdiom x:TypeArguments ="x:Double" Phone ="15" Tablet ="20"/>
</Label.FontSize>
</Label>
<Label Text="{Binding Description}" TextColor="#323232">
<Label.FontSize>
<OnIdiom x:TypeArguments ="x:Double" Phone ="11" Tablet ="16"/>
</Label.FontSize>
</Label>
<StackLayout Orientation="Horizontal">
<Label Text="£" TextColor="Black">
<Label.FontSize>
<OnIdiom x:TypeArguments ="x:Double" Phone ="14" Tablet ="19"/>
</Label.FontSize>
</Label>
<Label Text="{Binding Cost}" TextColor="Black">
<Label.FontSize>
<OnIdiom x:TypeArguments ="x:Double" Phone ="14" Tablet ="19"/>
</Label.FontSize>
</Label>
</StackLayout>
</StackLayout>
<StackLayout Grid.Column="1" Orientation="Horizontal" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Image Source="minus.png">
<Image.WidthRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="25" Tablet ="35"/>
</Image.WidthRequest>
<Image.HeightRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="25" Tablet ="35"/>
</Image.HeightRequest>
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="RemoveItemBtnClicked"/>
</Image.GestureRecognizers>
</Image>
<Label Text="{Binding TotalQuantity}" HorizontalOptions="Center" VerticalOptions="Center" TextColor="Black">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="13" Android="13" WinPhone="13" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="15" Android="15" WinPhone="15" />
</OnIdiom.Tablet>
</OnIdiom>
</Label.FontSize>
</Label>
<Image Source="add.png">
<Image.WidthRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="25" Tablet ="35"/>
</Image.WidthRequest>
<Image.HeightRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="25" Tablet ="35"/>
</Image.HeightRequest>
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="AddItemBtnClicked"/>
</Image.GestureRecognizers>
</Image>
</StackLayout>
</Grid>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</DataTemplate>
</cv:CarouselView.ItemTemplate>
</cv:CarouselView>

Dynamic picker elements in ListView

I am new to Xamarin forms.I am designing an application in which I want to display a list of pickers in a list view.The vales in the picker should be dynamic.Below is the code I have written.I struck at writing a List of Picker items in a List.Please anyone help me.Sorry for my English.Thanks in advance.
<ListView x:Name="WindowsList" BackgroundColor="Transparent"
ItemsSource="{Binding KitchenWindowsList}"
HeightRequest="300" IsVisible="{Binding KitchenVisibility}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Padding="5" HorizontalOptions="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding KitchenWindowName}" TextColor="#ece6dd" FontAttributes="Bold">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="15" Android="15" WinPhone="15" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="20" Android="20" WinPhone="20" />
</OnIdiom.Tablet>
</OnIdiom>
</Label.FontSize>
</Label>
<Picker x:Name="CurtainTypePicker" ItemsSource="{Binding TypeList}" Title="Choose Curtain" Grid.Column="1" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Picker.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="40"/>
</OnIdiom.Tablet>
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="30" Android="45"/>
</OnIdiom.Phone>
</OnIdiom>
</Picker.HeightRequest>
</Picker>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>

How to get selected item of Picker which is inside a ListView?

I am working on a listview in which I have a label and Picker.I want to detect the selected item of the picker which is inside the list view.I am not able to access the x:Name of picker in Xaml.cs file.Below is my code.Any one please help me if i am going in a wrong direction.Thanks in Advance.
Here is my Xaml code:
<ListView x:Name="MasterRoomList" BackgroundColor="Transparent"
ItemsSource="{Binding MasterRoomWindowsList}"
IsVisible="{Binding RoomsVisibility}" ItemTapped="OnItemTapped" SeparatorVisibility="None">
<ListView.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="150" Android="150" WinPhone="150" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="300" Android="300" WinPhone="300" />
</OnIdiom.Tablet>
</OnIdiom>
</ListView.HeightRequest>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Padding="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding RoomName}" TextColor="Black" FontFamily="Avenir Book" VerticalTextAlignment="Center">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="13" Android="13" WinPhone="13" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="20" Android="20" WinPhone="20" />
</OnIdiom.Tablet>
</OnIdiom>
</Label.FontSize>
</Label>
<Picker x:Name="CurtainPicker" BackgroundColor="Transparent" TextColor="Black" ItemsSource="{Binding CurtainsTypeList}" SelectedIndexChanged="CurtainPicker_OnSelectedIndexChanged" Title="Select Style" Grid.Column="1" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand">
<Picker.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="40"/>
</OnIdiom.Tablet>
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="30" Android="30"/>
</OnIdiom.Phone>
</OnIdiom>
</Picker.HeightRequest>
</Picker>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Here is my Xaml.cs Code:
private void CurtainPicker_OnSelectedIndexChanged(object sender, EventArgs e)
{
var selectedItem = (string) CurtainPicker.SelectedItem;
}
var picker = (Picker)sender;
var selectedItem = (string) picker.SelectedItem;

Xamarin Forms Fixed Size for an image

I'm trying to set the height and width of my image and have it a fixed size however if I shrink the container (frame, stackpanel, grid, etc...) the image shrinks along with it. However I would have assumed setting the height and width (WidthRequest, HeightRequest, MinimumHeightRequest, MinimumWidthRequest) would have forced the image to remain the set size... however it doesn't/
What can I do...
Try this; This will set the width and height of the image with the platform specific dimensions i.e. it will use dp for android and points for iOS.
<Image IsVisible="true">
<Image.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="72" Android="100" WinPhone="10" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="212" Android="140" WinPhone="10" />
</OnIdiom.Tablet>
</OnIdiom>
</Image.HeightRequest>
<Image.WidthRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="125" Android="150" WinPhone="10" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="265" Android="190" WinPhone="10" />
</OnIdiom.Tablet>
</OnIdiom>
</Image.WidthRequest>
<Image.Source>
<OnPlatform x:TypeArguments="ImageSource">
<OnPlatform.iOS>
<FileImageSource File="logo.png" />
</OnPlatform.iOS>
<OnPlatform.Android>
<FileImageSource File="logo.png" />
</OnPlatform.Android>
<OnPlatform.WinPhone>
<FileImageSource File="logo.png" />
</OnPlatform.WinPhone>
</OnPlatform>
</Image.Source>
</Image>

Resources