国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

布局中嵌套listview和edittest焦點問題

2019-11-09 14:51:20
字體:
來源:轉載
供稿:網友

當布局中嵌套listview和edittest 的時候,進入activity,第一次點擊edittext軟鍵盤可以彈出,滑動listview后再次點擊edittext軟鍵盤不彈出。

剛開始設置點擊edittext后強制調用軟鍵盤,測試不行,因為edittext焦點一直占用著。

解決方案:activity.xml 父布局加入

	android:focusable="true"	android:focusableInTouchMode="true"
完美解決。
附軟鍵盤彈出隱藏方法:
///////////////////////////////////////// 隱藏或顯示軟鍵盤 /////////////////////////////////public static void hideSoftKeyboard(EditText editText, Context context) {    if (editText != null && context != null) {        InputMethodManager imm = (InputMethodManager) context                .getSystemService(Context.INPUT_METHOD_SERVICE);        imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);    }}public static void showSoftKeyboard(EditText editText, Context context) {    if (editText != null && context != null) {        InputMethodManager imm = (InputMethodManager) context                .getSystemService(Activity.INPUT_METHOD_SERVICE);        imm.showSoftInput(editText, 0);    }}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 黔西县| 静宁县| 江油市| 黄大仙区| 黔江区| 绥宁县| 丹巴县| 团风县| 海兴县| 西藏| 双流县| 丰原市| 颍上县| 黑水县| 安国市| 宜黄县| 小金县| 闽清县| 宁强县| 那曲县| 凌云县| 洛南县| 宝山区| 汉沽区| 广昌县| 定兴县| 乳山市| 特克斯县| 江山市| 澄迈县| 永顺县| 云阳县| 蒲江县| 华容县| 荣成市| 台湾省| 西安市| 广州市| 苍溪县| 壶关县| SHOW|