I am developing an application in which the background image get shrink on keyboard pop-up. My .xml is as follows :
You should move the android:background="@drawable/background"
in an ImageView
above ScrollView
. When the keyboard pops up it effectivly makes the screen smaller, and having an image as background you have no control on how it is resized/cropped.
So, assuming you want to have the image full width but keep the ascpect ratio try this:
/**
Other stuff
*/
You can try different android:scaleType
values to achive your desired effect. If you want the image to be cropped from the top instead of the default middle crop, see here on how to achieve this, or try using this library