Search code examples
androidscrollviewandroid-softkeyboardandroid-keypad

Prevent shrinking of background image of a scroll view when keypad is opened


I have a scroll view which has a background image. When the keypad is opened, the image gets shrunk. When the keypad is closed, it expands again. How to stop this shrinking from happening?


Solution

  • you should add this to your manifset file between your related activity tags

    android:windowSoftInputMode="stateVisible|adjustPan"
    

    adjustPan means ; your activity will not be resized to fit new sizes when keyboard opened, and it will keep old form