requestFoucs();无效。 requestFoucsFromTouch();无效。 WEBview.setTouchListener;无效。 问题所在: 继承We
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无法弹出软键盘的原因及解决办法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对编程网网站的支持!
您可能感兴趣的文章:Android屏蔽软键盘自动弹出的解决方案Android 软键盘弹出时把原来布局顶上去的解决方法android避免弹出软键盘遮盖listview的简单方法Android软键盘弹出时的界面控制方法解析android中隐藏与显示软键盘及不自动弹出键盘的实现方法解决Android软键盘弹出覆盖h5页面输入框问题
--结束END--
本文标题: Android WebView无法弹出软键盘的原因及解决办法
本文链接: https://www.lsjlt.com/news/24814.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-01-21
2023-10-28
2023-10-28
2023-10-27
2023-10-27
2023-10-27
2023-10-27
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0