假如这个是你的自定义WebView:

public class XWebView extends WebView {    public XWebView(Context context) {        this(context, null);    }        public XWebView(Context context, AttributeSet attributeSet) {        this(context, attributeSet, 0);    }    public XWebView(Context context, AttributeSet attributeSet, int i) {        super(context, attributeSet, i);        initWebViewSettings(context);    }}

那么你的WebView弹不出软键盘是正常的;且看第二个构造方法:this(context, attributeSet, 0); 看到这个0了吗?把它改为 com.android.internal.R.attr.webViewStyle ;如果编译报错的话就试试这个Resources.getSystem().getIdentifier("webViewStyle","attr","android")

public class XWebView extends WebView {    public XWebView(Context context) {        this(context, null);    }    /**     * 不能直接调用this(context, attrs,0),最后style是0的话,会导致无法响应点击动作。     */    public XWebView(Context context, AttributeSet attributeSet) {        this(context, attributeSet, Resources.getSystem().getIdentifier("webViewStyle","attr","android"));    }    public XWebView(Context context, AttributeSet attributeSet, int i) {        super(context, attributeSet, i);        initWebViewSettings(context);    }}

 this(context, attributeSet, Resources.getSystem().getIdentifier("webViewStyle","attr","android"));

OK 

更多相关文章

  1. 解决ios软键盘输入框被遮挡问题
  2. Android软键盘遮挡布局的那些事
  3. Android点击事件隐藏软键盘
  4. android隐藏弹出软键盘
  5. android 点击空白 隐藏软键盘
  6. Android判断软键盘是否显示
  7. Android点击按钮隐藏或者打开软键盘

随机推荐

  1. android > 调用拨打电话 并子线程监控然
  2. 基于Phone模块的Service实现
  3. Android API 指南
  4. Android使用系统Intent实现分享功能及将
  5. android横屏竖屏 实现
  6. Android游戏开发学习(1)--android设置全
  7. Dealing with bitmap object in android
  8. Android 视频播放
  9. Android属性设置大全
  10. android 图片相关处理