maw
maw

Reputation: 11

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 stuff:

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?

Upvotes: 1

Views: 4137

Answers (2)

bapho
bapho

Reputation: 936

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>

Upvotes: 1

Rohit
Rohit

Reputation: 31

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

Upvotes: 3

Related Questions