And because mainLayout is inside a LinearLayout this means that that part does't get resized (again see picture in question). In the "facebook" login pictures posted in the question I've also noticed that the whole login part (mainLayout) is centered vertical in relation to the whole screen, hence the attribute: android:layout_centerVertical="true" If there wouldn't be a LinearLayout inside that RelativeLayout "facebook" text would get crushed and wouldn't be shown. And you need to have a LinearLayout inside a RelativeLayout else your insides would get crushed when the resizing occurs. That's why you need to have 1 RelativeLayout immediately after ScrollView to span thru all available screen space. I've realized that RelativeLayout are the layouts that span thru all available space and are then resized when the keyboard pops up.Īnd LinearLayout are layouts that don't get resized in the resizing process. I've spend a couple of hours figuring out things and here is my complete solution with detailed explanation at the bottom: Īnd in AndroidManifest.xml, don't forget to set: android:windowSoftInputMode="adjustResize" This question has beeen asked a few years ago and "Secret Andro Geni" has a good base explanation and "tir38" also made a good attempt on the complete solution, but alas there is no complete solution posted here. #Android keypad layout codeSome source code below for layout design In your AndroidManifest.xml where you declare this particular activity and this will adjust the layout resize option. Just add android:windowSoftInputMode="adjustResize"
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |