首页 > 系统 > Android > 正文

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

2019-10-23 20:35:50
字体:
来源:转载
供稿:网友

requestFoucs();无效。

requestFoucsFromTouch();无效。

webview.setTouchListener;无效。

问题所在:

继承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无法弹出软键盘的原因及解决办法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对VEVB武林网网站的支持!


注:相关教程知识阅读请移步到Android开发频道。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表