我下面有简单的文本字段。当我按下 SofInput 键盘的 TextInputAction 按钮时,我想调用我的搜索功能。
TextField(
keyboardType: TextInputType.phone,
textInputAction: TextInputAction.search,
decoration: InputDecoration(hintText: 'Enter Number'),
),
// Example only
void myCustomFunction() => SearchNumber();
Run Code Online (Sandbox Code Playgroud)
我试图在用户单击 AutoComplateTextView 项目时隐藏软件键盘,但它不起作用。
这是我的代码:
mAutoCompleteTextView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
/**
* do something
*/
InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromInputMethod(mAutoCompleteTextView.getWindowToken(), 0);
}
});
Run Code Online (Sandbox Code Playgroud) 我正在开发自定义键盘。我正在按照此链接制作此键盘
https://code.tutsplus.com/tutorials/create-a-custom-keyboard-on-android--cms-22615
作为android开发的初学者,我已经更改了一些设计并在此键盘中添加了颜色。但是当我在android设备中尝试此功能并启用此键盘时,它似乎会引起注意
此输入法可能能够收集您键入的所有文本,包括密码和信用卡号之类的个人数据。....
因为我没有从用户那里获取任何数据,所以我想禁用此功能。我已经禁用了AndroidManifest.xml文件中的所有权限。但是它不起作用,我如何以编程方式禁用它并禁用此权限?
我有至少2个活动,其中有EditTexts,你可以输入/更新数据..但在我的设备上,我总是要按后退按钮摆脱弹出的键盘.输入值后,有没有办法解除它?如果是这样,代码是什么,你会把它放在哪里.或者让它遍历字段或其他东西..我只是希望它在用户完成输入时消失.
keyboard android android-softkeyboard android-edittext android-activity
我在Linearlayout中有两个EditText视图和一个Button.完成edittext中的写入后,我想隐藏Android虚拟键盘,我该怎么做?
android android-softkeyboard android-edittext android-virtual-keyboard