久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

鍵盤出現(xiàn)時 ListActivity 中的編輯文本 ListView 失去

Edit Text in ListActivity ListView loses focus when keyboard comes up(鍵盤出現(xiàn)時 ListActivity 中的編輯文本 ListView 失去焦點)
本文介紹了鍵盤出現(xiàn)時 ListActivity 中的編輯文本 ListView 失去焦點的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我已經(jīng)搜索并搜索了這個問題的答案,但所有看起來像是答案的東西都沒有奏效,所以我想我會問的.

I have searched and searched for an answer to this question and everything that looked like an answer has not worked so I guess I will just ask.

我在 ListView 中添加了幾個 EditText 框,這是 ListActivity 的基礎(chǔ).當我將 windowSoftInputMode 設(shè)置為 adjustPan 并單擊 EditText 時,它會起作用,直到您再次單擊它,然后鍵盤將其覆蓋.當我使用 adjustResize 時,它可以工作,除非當鍵盤出現(xiàn)時 EditText 失去焦點,我必須再次點擊它才能輸入.

I have a couple of EditText boxes added to a ListView that is the basis to a ListActivity. When I set the windowSoftInputMode to adjustPan and click in an EditText it works until you click on it again and then the keyboard covers it up. When I use adjustResize it works except when the keyboard comes up the EditText loses focus and I have to tap on it again to type.

我試圖弄清楚如何捕捉 onResize 但這似乎與視圖相關(guān)聯(lián),而不是活動,我不完全確定如何聽它.我還嘗試了 EditText 框和 ListView 本身的各種可聚焦設(shè)置(如我閱讀的其他帖子中所建議的那樣),這些設(shè)置似乎也無濟于事.

I was trying to figure out how to catch the onResize but that seems to be associated with the View and not the activity and I'm not entirely sure how to listen for it. I have also tried all sorts of focusable settings on the EditText boxes and the ListView itself (as suggested in other posts I read) that don't seem to help either.

推薦答案

您真正需要做的就是將它應(yīng)用到您的 ListView:

All you really need to do is apply this to your ListView:

XML:

android:descendantFocusability="afterDescendants"

Java:

listView.setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);

這篇關(guān)于鍵盤出現(xiàn)時 ListActivity 中的編輯文本 ListView 失去焦點的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

EditText: Disable Paste/Replace menu pop-up on Text Selection Handler click event(EditText:禁用文本選擇處理程序單擊事件上的粘貼/替換菜單彈出)
Multiline EditText with Done SoftInput Action Label on 2.3(2.3 上帶有完成 SoftInput 操作標簽的多行 EditText)
How to detect the swipe left or Right in Android?(如何在 Android 中檢測向左或向右滑動?)
Prevent dialog dismissal on screen rotation in Android(防止在Android中的屏幕旋轉(zhuǎn)對話框解除)
How do I handle ImeOptions#39; done button click?(如何處理 ImeOptions 的完成按鈕點擊?)
How do you set EditText to only accept numeric values in Android?(您如何將 EditText 設(shè)置為僅接受 Android 中的數(shù)值?)
主站蜘蛛池模板: 超碰成人免费观看 | 久久国产一区二区 | 五月激情综合网 | 亚洲精品一区二区三区四区高清 | 国产专区在线 | 国产成人精品一区二区 | 女人牲交视频一级毛片 | 在线视频 亚洲 | 视频一区二区在线 | 男人av网 | 久久久不卡网国产精品一区 | 超碰97免费观看 | 天堂综合| 色婷婷亚洲国产女人的天堂 | 日产精品久久久一区二区福利 | 欧美色欧美亚洲另类七区 | 99热视| 成人亚洲 | 欧美小视频在线观看 | 欧美日韩综合一区 | 欧美一级二级在线观看 | 亚洲国产精品成人 | 欧美成人影院在线 | 日本久久网 | 欧美影院久久 | 欧美视频网 | 欧美aⅴ片| 成人激情视频免费在线观看 | 日韩欧美一区在线 | 日本一区视频在线观看 | 中文在线一区二区 | 91精品国产综合久久福利软件 | 国产成人一区二区三区电影 | 免费精品在线视频 | 极品在线 | 国产成人精品免费视频大全最热 | 北条麻妃av一区二区三区 | 中文字幕视频在线 | 精品中文在线 | 亚洲欧美视频在线观看 | 国产综合久久久 |