我可以阻止来自Xamarin.forms的键盘建议吗 [英] Can I prevent keyboard suggestions from Xamarin.forms
问题描述
我正在尝试使用xamarin.forms来开发Android应用程序,并且需要防止在文本字段上提出完成建议.在香草Android中,我会将输入类型设置为type_text_flag_no_suggestions.我可以使用xaml从xamarin.forms进行此布局吗?
在构建页面用户界面的代码中,将Keyboard
属性添加到Entry
,然后使用Create
方法指定KeyboardFlags
枚举的None
常量.这指定在用户输入的文本上将不提供建议的单词补全.
Content = new StackLayout {
Padding = new Thickness(0,20,0,0),
Children = {
new Entry { Keyboard = Keyboard.Create(KeyboardFlags.None) }
}
};
注意:此标志还将禁用您的其他标志.
尚未更新文档,但现在添加了此标志检查 github ./p>
其他参考:
- https://stackoverflow.com/a/26978071/3758024
- https://developer.xamarin.com/recipes/cross-platform/xamarin-forms/controls/choose-keyboard-for-entry/#Specifying_additional_keyboard_options
I'm trying to use xamarin.forms to develop an Android app and need to prevent completion suggestions on a text field. In vanilla Android I would set the inputtype to type_text_flag_no_suggestions. Can I do this from xamarin.forms using xaml for the layout?
In the code building the user interface for a page, add a Keyboard
property to an Entry
, and use the Create
method to specify the None
constant of the KeyboardFlags
enumeration. This specifies that no suggested word completions will be offered on text that the user enters.
Content = new StackLayout {
Padding = new Thickness(0,20,0,0),
Children = {
new Entry { Keyboard = Keyboard.Create(KeyboardFlags.None) }
}
};
Note: this flag will also disable your other flags.
documentation is not updated but this flag is now added check github.
Additional references:
- https://stackoverflow.com/a/26978071/3758024
- https://developer.xamarin.com/recipes/cross-platform/xamarin-forms/controls/choose-keyboard-for-entry/#Specifying_additional_keyboard_options
这篇关于我可以阻止来自Xamarin.forms的键盘建议吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!