您可以在HTML5 / javaScript中调用任何方法来强制屏幕键盘出现在iOS / Android中吗?
我不是在寻找HTML5键盘,而只是为了通知设备它需要显示内部屏幕键盘。
谢谢
对于Android,您可以使用以下命令:
public void showSoftKeyboard(View v) {
Activity activity = (Activity) v.getContext();
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
inputMethodManager.showSoftInput(activity.getCurrentFocus().getWindowToken(), 0);
}
或致电:
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
对于iOS,我发现了这一点:
$('#element').focus().blur().focus();
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句