本文介紹了彈出窗口上的 EditText的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我正在使用 Java 在 Android 2.2 上進行開發.我在 PopupWindow 上放置了一個 editText,但它不起作用.它就像一個禁用的編輯文本,點擊編輯文本不會顯示軟鍵盤.如何在彈出窗口上添加編輯文本?
I am developing on Android 2.2 using Java. I put an editText on a PopupWindow and it's not working. It acts like a disabled edit text, clicking on the edit text won't show the soft keyboard. How can I add an edit text on a popupWindow?
推薦答案
我已經解決了這樣的問題:我把 popupWindow.setFocusable(true);
現在它正在工作.似乎彈出窗口上的編輯文本沒有焦點,因為彈出窗口沒有焦點.
I have resolved the problem like this: I put the popupWindow.setFocusable(true);
and now it's working. It seems that the edit text which was on a pop window didn't have focus because the popup window didn't have focus.
這篇關于彈出窗口上的 EditText的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!