开发者

Soft keyboard appears, Background image is resized

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜