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

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

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

問題描述

我已經(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ǔ).當(dāng)我將 windowSoftInputMode 設(shè)置為 adjustPan 并單擊 EditText 時,它會起作用,直到您再次單擊它,然后鍵盤將其覆蓋.當(dāng)我使用 adjustResize 時,它可以工作,除非當(dāng)鍵盤出現(xiàn)時 EditText 失去焦點(diǎn),我必須再次點(diǎn)擊它才能輸入.

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è)置似乎也無濟(jì)于事.

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 失去焦點(diǎn)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 操作標(biāo)簽的多行 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 的完成按鈕點(diǎn)擊?)
How do you set EditText to only accept numeric values in Android?(您如何將 EditText 設(shè)置為僅接受 Android 中的數(shù)值?)
主站蜘蛛池模板: 交专区videossex农村 | 久久av资源网 | 国产精品精品视频一区二区三区 | 91极品欧美视频 | www.日本在线 | 国产精品视屏 | av黄色片在线观看 | 久久精品国产一区二区三区不卡 | 日韩一区二区av | 久久免费视频观看 | 中文字幕亚洲一区 | 大香在线伊779 | 一区二区在线不卡 | 欧美国产日韩一区 | 日韩电影一区 | 亚洲综合精品 | 成人小视频在线 | 99热免费在线 | 91精品免费| 午夜精品一区二区三区在线视 | 成人视屏在线观看 | 99色视频| 亚洲电影中文字幕 | 欧美一区久久 | 久久久网 | 一级a爱片性色毛片免费 | 成人精品国产免费网站 | 日韩欧美三级电影 | 爱草视频 | 欧美日韩精品区 | 北条麻妃一区二区三区在线视频 | 国产一区亚洲二区三区 | 天天夜碰日日摸日日澡 | av色站 | 国产一伦一伦一伦 | 一区二区精品在线 | 欧美一区二区三区视频在线 | 久久一区二区三区四区 | 亚洲成人精品国产 | 国际精品鲁一鲁一区二区小说 | 国产线视频精品免费观看视频 |