安卓网页 View 。键盘隐藏

标签 android webview

点击时显示键盘。当您单击屏幕的其他区域时,键盘会隐藏。是否可以防止点击屏幕其他区域时隐藏键盘?

最佳答案

尝试隐藏键盘

public static void hideSoftKeyboard(Activity context) {
    InputMethodManager inputManager = (InputMethodManager) context
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    if (inputManager != null)
        inputManager.hideSoftInputFromWindow(context.getWindow()
                .getDecorView().getApplicationWindowToken(), 0);
    context.getWindow().setSoftInputMode(
            WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

}

关于安卓网页 View 。键盘隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34394678/

相关文章:

java - Android 3.1 WebView 溢出滚动 - 不在滚动上呈现长列表

android - 是否可以将android应用程序的背景制作成gif之类的动画背景?

android - fragmentContainer 是 fragment 的唯一标识符?

java - android 使用总是发布请求而不是获取

android - 如何将安卓设备连接到 PPTP VPN

Web View 中的 Android 文本输入显示第二个框

android - Sencha Touch web 移动应用程序开发

使用 phonegap 的 android tcp/ip 客户端

iphone - UIWebview 加载安全页面缓慢

android - 从android中的html字符串单击时如何获取href链接打开到webView?