开发者

Soft keyboard appears, Background image is resized

开发者 https://www.devze.com 2023-02-17 05:00 出处:网络
I have a ListView with an edittext and a button at the bottom of my screen. When the soft keyboard appears it squeezes my image. I tried a few s开发者_运维百科tuff:

I have a ListView with an edittext and a button at the bottom of my screen. When the soft keyboard appears it squeezes my image. I tried a few s开发者_运维百科tuff:

1)android:windowSoftInputMode="adjustPan" The image doesn't get squashed, nice. But the ListView items cannot be scrolled anymore.

2)android:windowSoftInputMode="adjustResize" Does nothing.

Any ideas anyone?


Use getWindow().setBackgroundDrawable() in your activity to set the background.


Use android:windowSoftInputMode="adjustResize" and simply wrap your background to a ImageView in a ScrollView.

<ScrollView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:scrollbars="none"
    android:overScrollMode="never">
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/> 
</ScrollView>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号