Android WebView无法弹出软键盘的原因及解决办法
作者:mrr 时间:2023-07-07 18:30:00
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无法弹出软键盘的原因及解决办法,希望对大家有所帮助!
标签:webview,弹出,软键盘
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Flutter刷新组件RefreshIndicator自定义样式demo
2023-07-06 15:56:45
![](https://img.aspxhome.com/file/2023/2/58272_0s.webp)
Android 微信摇一摇功能实现详细介绍
2023-06-21 21:00:09
Android 实现签到足迹功能
2023-06-21 15:16:24
![](https://img.aspxhome.com/file/2023/3/83543_0s.jpg)
Json操作库DynamicJson使用指南
2023-06-17 10:17:35
Android Studio多渠道打包的配置方法
2023-06-15 23:19:48
![](https://img.aspxhome.com/file/2023/5/83535_0s.png)
Flutter瀑布流仿写原生的复用机制详解
2023-06-20 17:02:08
![](https://img.aspxhome.com/file/2023/0/98700_0s.jpg)
Android 动画之TranslateAnimation应用详解
2023-06-27 06:17:59
![](https://img.aspxhome.com/file/2023/1/82411_0s.png)
探讨:将两个链表非降序合并为一个链表并依然有序的实现方法
2023-06-23 01:41:38
formfile文件上传使用示例
2023-06-23 03:41:58
Spring Cache框架应用介绍
2023-06-15 22:32:59
![](https://img.aspxhome.com/file/2023/2/57492_0s.png)
opencv 做人脸识别 opencv 人脸匹配分析
2023-07-09 06:34:44
![](https://img.aspxhome.com/file/2023/8/101078_0s.jpg)
C# BitArray(点矩阵)转换成int和string的方法实现
2023-06-18 07:33:44
![](https://img.aspxhome.com/file/2023/0/66110_0s.png)
合成聚合复用原则_动力节点Java学院整理
2023-06-27 22:05:20
![](https://img.aspxhome.com/file/2023/9/57599_0s.png)
10种简单的Java性能优化
2023-06-20 20:43:41
![](https://img.aspxhome.com/file/2023/6/57526_0s.png)
C#获取网页源代码的方法
2023-06-19 05:43:44
Flutter应用集成极光推送的实现示例
2023-06-24 03:51:04
![](https://img.aspxhome.com/file/2023/2/90172_0s.jpg)
Android SharedPreferences实现记住密码和自动登录界面
2023-06-15 20:07:00
![](https://img.aspxhome.com/file/2023/9/83529_0s.png)
C#创建临时文件的方法
2023-06-16 14:32:36
Java 信号量Semaphore的实现
2023-06-19 11:00:34
C++右值引用与move和forward函数的使用详解
2023-07-05 19:27:33