Android WebView無法彈出軟鍵盤的原因及解決辦法
requestFoucs();無效。
requestFoucsFromTouch();無效。
webview.setTouchListener;無效。
問題所在:
繼承WebView時,注意構(gòu)造方法:
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無法彈出軟鍵盤的原因及解決辦法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
相關(guān)文章
Android編程開發(fā)中ListView的常見用法分析
這篇文章主要介紹了Android編程開發(fā)中ListView的常見用法,較為詳細的分析了ListView的功能及常見使用方法,具有一定參考借鑒價值,需要的朋友可以參考下2015-10-10
Android基于TextView屬性android:ellipsize實現(xiàn)跑馬燈效果的方法
這篇文章主要介紹了Android基于TextView屬性android:ellipsize實現(xiàn)跑馬燈效果的方法,涉及Android跑馬燈效果所涉及的TextView相關(guān)屬性與使用方法,需要的朋友可以參考下2016-08-08
在Android中動態(tài)添加Panel框架的實現(xiàn)代碼
項目經(jīng)常會有這種需求,就是想動態(tài)的在某個界面上添加一個Panel。比如,有一個按鈕,點擊后會顯示下拉菜單式的界面。這種需求,就屬于動態(tài)添加一個Panel。需求多了,就要研究是否可以抽象出通用的框架代碼,以方便開發(fā),所以就有了以下內(nèi)容2013-05-05
Android UI設(shè)計與開發(fā)之仿人人網(wǎng)V5.9.2最新版引導界面
這篇文章主要為大家詳細介紹了Android UI設(shè)計與開發(fā)之仿人人網(wǎng)V5.9.2最新版引導界面,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-08-08
Android軟件啟動動畫及動畫結(jié)束后跳轉(zhuǎn)的實現(xiàn)方法
這篇文章主要介紹了Android軟件啟動動畫及動畫結(jié)束后跳轉(zhuǎn)的實現(xiàn)方法,實例分析了Android圖片播放及定時器的相關(guān)使用技巧,非常具有使用價值,需要的朋友可以參考下2015-10-10

