When the software keyboard shows, it resizes my layout and thus squeezes the background image together. My question is basically a duplicate of this question, which is explained in a very good way:
Software keyboard resizes background image on Android
However, that question was closed when they found a hack to solve it. I cannot use this hack. My entire layout is inside a ScrollView, and I need to be able to use this scrollview properly at all times. By using android:windowSoftInputMode="stateVisible|adjustPan" the user will not be able to scroll down and see the bottom of the screen while the keyboard is showing, since the layout will partly exist behind the keyboard. Thus the solution is unacceptable to me. Are there any better solutions out there?
Cheers,
You can use the windowBackground property, which makes the drawable fit the whole screen. To do that you need to:
1- Create a style:
2- Set your activity style in the AndroidManifest.xml
Maybe there's another (really simple!) solution: In styles.xml: create a new style like this:
AppBaseTheme is your normally used theme for your app. Then you add in Manifest.xml:
So you have the same style but with a background.
Important: don't set any backgrounds in your normal .xml file!
It's my first post and I hope it helps and sorry for my English.
in Androidmanifest in activity tag use:
check Android Developer reference