android - 我可以阻止来自 Xamarin.forms 的键盘建议吗

标签 android xamarin.forms

我正在尝试使用 xamarin.forms 开发一个 Android 应用程序,并且需要防止在文本字段上完成建议。在 vanilla Android 中,我会将 inputtype 设置为 type_text_flag_no_suggestions。我可以使用 xaml 从 xamarin.forms 执行此操作吗?

最佳答案

在为页面构建用户界面的代码中,添加 Keyboard属性到 Entry ,并使用 Create指定 None 的方法KeyboardFlags 的常数枚举。这指定不会为用户输入的文本提供建议的单词补全。

Content = new StackLayout {
    Padding = new Thickness(0,20,0,0),
    Children = {
        new Entry { Keyboard = Keyboard.Create(KeyboardFlags.None) }
    }
};

注意:这个标志也会禁用你的 other flags .

documentation未更新,但现在添加了此标志检查 github .

附加引用:
  • https://stackoverflow.com/a/26978071/3758024
  • https://developer.xamarin.com/recipes/cross-platform/xamarin-forms/controls/choose-keyboard-for-entry/#Specifying_additional_keyboard_options
  • 关于android - 我可以阻止来自 Xamarin.forms 的键盘建议吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41338767/

    相关文章:

    android - ArrayAdapter<String> 过滤器仅从单词开头匹配

    c# - Xamarin Forms 中没有 WebClient 类

    xamarin.forms - Xamarin 表单,动态添加新项目到 ListView

    android - AVRDUDE Android Arduino ioctl 错误

    android - 如何使任何 View 背景透明?

    android - U-boot:双启动 + 虚拟内核 + 修改后的启动图像

    javascript - 在 phonegap 中处理后退和菜单按钮

    xamarin - 在 xamarin.forms 中弹出

    xaml - ListView Xamarin.Forms 内的 ListView

    c# - xamarin.forms GCM 未接收消息