問題描述
我發現 this 舊帖子肯定有助于解決我的問題,但我注意到它似乎并沒有真正解決我的問題.我已經收集到我需要為我的活動設置 android:windowSoftInputMode="adjustPan" .但問題是它根本不夠平移.
I found this old post which definitely helps with my problem, but I'm noticing that it doesn't really seem to solve my problem. I have gathered that I need to set android:windowSoftInputMode="adjustPan" for my activity. But the issue is that it simply doesn't pan ENOUGH.
文本字段位于視圖的底部,當鍵盤出現時,視圖會稍微移動,但只會移動到 EditText 的最頂部.文本字段已打開自動完成功能,當它開始顯示自動完成選項時,視圖會稍微向下平移,但實際上最終會被自動完成選項進一步遮擋.這使得文本輸入字段很難使用,因為您看不到正在輸入的任何內容.
The text field is toward the bottom of the view, and when the keyboard shows up, the view shifts slightly but only the very top of the EditText. The text field has autocomplete turned on, and when it begins to show autocomplete options, the view pans down slightly more, but actually winds up even further obscured by the autocomplete options. It makes the text input field very difficult to use since you can't see anything you're typing.
這是一個多行輸入字段,當文本滾動到下一行時,視圖會平移更遠,因此您實際上可以看到上一行文本.但是你看不到你在輸入什么,我認為這很重要.
It is a multiline input field, and when text rolls to the next line, the view pans farther, so you can actually see the previous line(s) of text. But you cannot see what you're typing, which I think is pretty important.
有人對解決這個問題有什么想法嗎?
Does anyone have any thoughts on solving this issue?
推薦答案
所以,我找到了問題的原因.在我設置的 AndroidManifest.xml 中
So, I've found what appears to be the cause of the issue. In my AndroidManifest.xml I had set
<uses-sdk android:minSdkVersion="3" />
顯然,使用低于4"的 minSdkVersion 是問題的根源.將其更改為4"后,布局顯示為應有的樣子,并且 EditText 的第一行適當地位于軟鍵盤頂部上方.
Apparently, using a minSdkVersion below "4" was at the root of the problem. On changing it to "4", the layout appeared as it should have, and the EditText had its first line above the top of the soft keyboard appropriately.
感謝您的幫助,火衛一.
Thanks for the help, Phobos.
這篇關于與 EditText 字段重疊的軟鍵盤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!