源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Android WebView无法弹出软键盘的原因及解决办法

  • 时间:2020-01-07 02:15 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Android WebView无法弹出软键盘的原因及解决办法
requestFoucs();无效。 requestFoucsFromTouch();无效。 webview.setTouchListener;无效。 [b]问题所在:[/b] 继承WebView时,注意构造方法:
public CommonWebView(Context context) {
super(context);
init();
}
public CommonWebView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public CommonWebView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
defStyleAttr不能传0,如下错误写法:
public CommonWebView(Context context) {
this(context,null,0);
}
public CommonWebView(Context context, AttributeSet attrs) {
this(context, attrs,0);
}
public CommonWebView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
以上所述是小编给大家介绍的Android WebView无法弹出软键盘的原因及解决办法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对编程素材网网站的支持!
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部