How to prevent Soft Keyboard from resizing background image

前端 未结 12 1806
耶瑟儿~
耶瑟儿~ 2020-12-30 00:09

I have a typical listview with an edittext and a button at the bottom of the activity.

When I click onto the edittext, the sof

12条回答
  •  执念已碎
    2020-12-30 00:48

    I read a lot of answers over StackOverflow and took some from many to make my app works:

    1. No ScrollView at all in my activity_main.xml

    2. In AndroidManifest.xml added this attribute to the

    tag:

    android:windowSoftInputMode="adjustResize"
    
    1. In MainActivity.java inside onCreate() I added getWindow().setBackgroundDrawableResource(R.drawable.app_bg);

    It works for me when all the other solutions I've tried didn't. If you got up to here, I hope it'll work for you too.

提交回复
热议问题