简体   繁体   中英

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

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?

使用RelativeLayout并使用android:layout_alignParentBottom="true"放置EditText ,然后在显示键盘时自动引发。

//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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM