首页 > 解决方案 > xamarin 表单键盘涵盖的编辑器

问题描述

你好朋友你好吗?我告诉你,我有一个旨在编写消息并存储它的页面。问题是当我将自己定位在编辑器中时,屏幕被剪切,仅显示编辑器的一半。会发生什么?你可以帮帮我吗?。非常感谢您的帮助。

在此处输入图像描述

这是我的代码:

</TabbedPage>  
<ContentPage>
    ....
</ContentPage>  
<ContentPage>
    ....
</ContentPage>
<ContentPage x:Name="MessagesContentPage" Title="Messages" >
    <Grid BindingContext="{Binding MessageViewModel}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0" VerticalOptions="Start">
            <ScrollView>
                <ListView
                     x:Name="OpportunityMessagesListView"
                     SeparatorVisibility="Default"
                     IsRefreshing="{Binding IsRefreshing}" 
                     SelectionMode="None" >
                    <ListView.ItemTemplate>
                        <DataTemplate >
                            <ViewCell >
                                <ViewCell.ContextActions>

                                    <MenuItem x:Name="MenuItemDeleteMessage" Clicked="MenuItemDeleteMessage_Clicked" Text="Eliminar" IsDestructive="True"  CommandParameter="{Binding Id}" IsEnabled="{Binding IsMenuEnabled}">
                                        <!--<MenuItem.IconImageSource>
                                            <FontImageSource Glyph="Rechazar"  FontFamily="{StaticResource FontAwesomeSolid}" Color="#e82424" />
                                        </MenuItem.IconImageSource>-->
                                    </MenuItem>
                                </ViewCell.ContextActions>
                                <Grid  x:Name="Item" Padding="3" >
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Label Grid.Row="0" Grid.Column="0" Margin="0"   Text="{Binding Message}" VerticalTextAlignment="Center" HorizontalTextAlignment="Start" HorizontalOptions="FillAndExpand"  LineBreakMode="CharacterWrap"/>
                                    <Label  Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding CreationTime, StringFormat='{0:yyyy-MM-dd HH:mm:ss}'}" TextColor="LightGray" BackgroundColor="Transparent" HorizontalTextAlignment="End"/>
                                </Grid>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
            </ScrollView>
        </Grid>
        <Grid Grid.Row="1" VerticalOptions="End"  Padding="3" Margin="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="8*" />
                <ColumnDefinition Width="2*" />
            </Grid.ColumnDefinitions>
            <customControl:ExtendedEditor x:Name="MessageExtendedEditor"  Grid.Row="0" Grid.Column="0" AutoSize="TextChanges"   Placeholder="Esccriba información de seguimiento" />
            <Button Grid.Row="0" Grid.Column="1" x:Name="SaveMessageButton" Clicked="SaveMessageButton_Clicked"  FontFamily="{StaticResource FontAwesomeSolid}" Text="&#xf35a;" HeightRequest="57" VerticalOptions="End" FontSize="27" BackgroundColor="Transparent" BorderColor="Transparent" TextColor="#5694ff" />
        </Grid>
    </Grid>
</ContentPage>

标签: xamarin.forms

解决方案


作为一个建议,考虑到我们正在谈论 Xamarin Forms,最好解释一下您是否仅在 Android、iOS 或两者(或 UWP 以防万一)上遇到此问题。

无论如何,我认为在以下链接中您可以找到所需的所有帮助

https://xamarinhelp.com/accommodate-on-screen-keyboard-xamarin-forms/

让我知道它是否能解决您的问题。如果它不能解决您的问题,我认为最好以更详细的方式解释问题。


推荐阅读