Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make windowSoftInputMode="adjustPan" pan more

Tags:

android

pan

I have an activity with a bunch of EditText fields on it, and the windowSoftInputMode is set to adjustPan, this mostly does what I want, however for the editText at the bottom of the layout, it doesn't pan enough. It'll pan to show the top line of a multiline edit text, but as soon as you hit enter, the cursor moves down a line and is now hidden under the keyboard.

Is there anyway I can make it pan further so that the top of the editText is all the way at the top of the window.

Using adjustResize definitely won't do what I want, pan is the right thing, just need it to pan further.

like image 771
superfell Avatar asked Jan 25 '12 04:01

superfell


People also ask

What is window soft input mode?

Posted on October 25, 2010 by Lars Vogel. Android has the so-called Input Method Framework to support different input methods, e.g. keyboard, soft-keyboard, handwriting etc. If the soft-keyboard is used it is diplayed at the bottom of the screen once the user select an text view to edit it.


2 Answers

Same thing was happen with me.

What I did to resolve is, I just put all the controls in ScrolllView.

And set android:windowSoftInputMode adjustResize. So whenever keyboard is open it will scroll the screen to adjust the view and Edittext always show on screen.

Hope this idea works for you.

Thanks

like image 175
Biraj Zalavadia Avatar answered Oct 21 '22 00:10

Biraj Zalavadia


Put your EditText inside the ScrollView and then give property adjustResize, instead of adjustPan, it will automatically adjust your screen and its components.

like image 25
Pratik Dasa Avatar answered Oct 21 '22 01:10

Pratik Dasa