开发者

How to move my edittext up when stkeyboard is on

开发者 https://www.devze.com 2023-03-31 22:29 出处:网络
I have cre开发者_如何学Cated a login page. If I insert some text in edit text (username, password) etc then a softkeyboard is visible. but it comes on my password field view. So upper half of password

I have cre开发者_如何学Cated a login page. If I insert some text in edit text (username, password) etc then a softkeyboard is visible. but it comes on my password field view. So upper half of password field is visible while lower half is not because of that softkeyboard. I want when the softkeyboard is visible the password field to move up a little, so that the entire edittext will be visible.

Thanks


add this line in your menifest.xml file

<activity android:name=".your_activity" android:windowSoftInputMode="adjustResize"></activity>


Your layout should shift up automatically when it has focus and the softkeyboard is displaying. I have a login form and I've done nothing special to get this behaviour.


One way you can solve this is by having a ScrollView as the root of your layout.

0

精彩评论

暂无评论...
验证码 换一张
取 消