如何解决使用 SetImeOptions NoExtractUi 或 NoFullscreen 在 Xamarin Forms Android 中禁用全屏模式不起作用,如何解决这个问题?
我正在开发使用 AutoSuggestBox 的 Xamarin 表单应用。
在横向模式下的 iOS 上,它可以正常工作,但是在横向模式下使用 Android 时,由于全屏模式,它隐藏了键盘下的所有建议选项。
我在 AutosuggestBox 上 have tried using android:Entry.ImeOptions="NoExtractUi"
但它对我不起作用,因为底层 Entry 没有暴露,所以我试图孤立地实现这个机制。
然后我在视图上添加了一个测试 Entry 控件,看看它是否可以工作。但是,这也行不通。
我的 xaml:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="StruebyPhotoApp.MobileApp.Views.NewItemPage"
xmlns:asb="clr-namespace:dotMorten.Xamarin.Forms;assembly=dotMorten.Xamarin.Forms.AutoSuggestBox"
xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
ios:Page.UseSafeArea="true">
<ContentPage.Content>
<StackLayout Spacing="3" Padding="15">
<Entry android:Entry.ImeOptions="NoExtractUi" x:Name="TestText" />
为了加倍,我还在构造函数中添加了
using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
public NewItemPage()
{
InitializeComponent();
TestText.On<Android>().SetImeOptions(ImeFlags.NoExtractUi);
}
我也尝试将 NoExtractUi
更改为 NoFullscreen
并使用TestText.On<Android>().SetImeOptions(ImeFlags.NoExtractUi|ImeFlags.NoFullscreen);
我仍然在 Android 10
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。