I am creating chat application in Xamarin.Forms and it's main target is iOS and in that page contains ListView with sender and reciever's text content and at bottom contains Grid and in that grid contains Textbox and submit button on submit button it sends message and it works proper till now but when user long press on Entry than it goes behind the keyboard and until goes back and again arrive than works fine until now Entry is not visible.
I give my code here:
MyChat.xaml
<ContentPage.Resources>
<ResourceDictionary>
<local:MessageTemplateSelector x:Key="MessageTemplateSelector"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<StackLayout x:Name="MainStack">
<ListView x:Name="MainListView"
ItemTemplate="{StaticResource MessageTemplateSelector}"
ItemsSource="{Binding TempValues}"
HasUnevenRows="True"
ItemSelected="MyListView_OnItemSelected"
ItemTapped="MyListView_OnItemTapped"
IsPullToRefreshEnabled="True"
IsRefreshing="{Binding IsRefreshing}"
RefreshCommand="{Binding RefreshCommand}"
SeparatorVisibility="None"
BackgroundColor="{DynamicResource GreyLight}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent,
Property=Height,Factor=1,Constant=0}"/>
<Grid x:Name="MainControls" RowSpacing="1" ColumnSpacing="2" Padding="5"
BackgroundColor="#EFEFF4" VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Entry x:Name="txtMessage" Grid.Column="0" HeightRequest="40"
Placeholder="Message" Text="{Binding Text}" TextChanged="EnableSend"/>
<Frame x:Name="SubmitButton" Grid.Column="1" Margin= "0" Padding="0" HasShadow="false"
HeightRequest="25" BackgroundColor="Transparent">
<Frame.GestureRecognizers>
<TapGestureRecognizer Tapped="SubmitMessage_Click" NumberOfTapsRequired="1" />
</Frame.GestureRecognizers>
<Label Text="Submit" x:Name="sendButton" TextColor="#1f88b7" HeightRequest="20"
HorizontalOptions="Center" VerticalOptions="Center"/>
</Frame>
</Grid>
</StackLayout>
</ContentPage.Content>
MyChat.xaml.cs
private void MyListView_OnItemSelected(object sender, SelectedItemChangedEventArgs e)
{
MainListView.SelectedItem = null;
}
private void MyListView_OnItemTapped(object sender, ItemTappedEventArgs e)
{
MainListView.SelectedItem = null;
}
In above code submit command works proper and ListView Display proper but issue with long press of Entry.
If anyone know please help me.
Thanks in advance.