Android WebView无法弹出软键盘的原因及解决办法
requestFoucs();无效。
requestFoucsFromTouch();无效。
webview.setTouchListener;无效。
问题所在:
继承WebView时,注意构造方法:
publicCommonWebView(Contextcontext){
super(context);
init();
}
publicCommonWebView(Contextcontext,AttributeSetattrs){
super(context,attrs);
init();
}
publicCommonWebView(Contextcontext,AttributeSetattrs,intdefStyleAttr){
super(context,attrs,defStyleAttr);
init();
}
defStyleAttr不能传0,如下错误写法:
publicCommonWebView(Contextcontext){
this(context,null,0);
}
publicCommonWebView(Contextcontext,AttributeSetattrs){
this(context,attrs,0);
}
publicCommonWebView(Contextcontext,AttributeSetattrs,intdefStyleAttr){
super(context,attrs,defStyleAttr);
init();
}
以上所述是小编给大家介绍的AndroidWebView无法弹出软键盘的原因及解决办法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!
热门推荐
10 八一幼儿祝福语大全简短
11 公司乔迁食堂祝福语简短
12 婚礼结束聚餐祝福语简短
13 儿媳买车妈妈祝福语简短
14 毕业送礼老师祝福语简短
15 同事辞职正常祝福语简短
16 恭贺新婚文案祝福语简短
17 金店立秋祝福语简短英文
18 婆婆高寿祝福语大全简短