Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move the layout up when the soft keyboard is shown android

I have a login screen with two EditTexts and a login button in my layout. The problem is that, when I start typing, the soft keyboard is shown and covers the login button. How can I push the layout up or above the keyboard when it appears?

I do not want to use a ScrollView, just want to implement it without scrolling down. Please, suggest me some way of doing it. Thanks in advance.

like image 261
cavallo Avatar asked Feb 02 '12 11:02

cavallo


People also ask

How do I prevent the soft keyboard from pushing my view up in fragment?

Setting android:isScrollContainer = "false" inside the ScrollView worked for me. According to the documentation, settings "isScrollContainer" to true means that the scroll view can be resized to shrink its overall window so that there is space for an input method.


1 Answers

Set windowSoftInputMode property to adjustPan and adjustResize

<activity android:windowSoftInputMode="adjustPan|adjustResize"> </activity> 
like image 195
jeet Avatar answered Oct 10 '22 06:10

jeet