How do I make an EditText raise along with the keyboard when in focus?

孤者浪人 提交于 2019-12-12 16:04:58

问题


Just like in texting applications, I want the keyboard to push the dialog box up when it raises. The issue I'm currently having is that the keyboard actually raises over my dialog box and the screen does not scroll.

Here's what I want: (Don't have enough reputation to post images)

Image one (Before)

Image two (After)

See how nicely it raises? How do I go about doing that?


回答1:


Use a RelativeLayout and place your EditText using android:layout_alignParentBottom="true" it should then raise automatically when the keyboard is shown.




回答2:


//try windowsoftinput mode in your manifest xml file.

android:windowSoftInputMode="adjustResize"

adjustResize 0x10 Always resize the window: the content area of the window is reduced to make room for the soft input area

.

ref this



来源:https://stackoverflow.com/questions/8911714/how-do-i-make-an-edittext-raise-along-with-the-keyboard-when-in-focus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!