2011-03-14 68 views
0

我有一個ListView,在屏幕底部有一個edittext和一個按鈕。當出現軟鍵盤時,它會擠壓我的圖像。我嘗試了一些東西:軟鍵盤出現,背景圖像調整大小

1)android:windowSoftInputMode =「adjustPan」圖像不會被壓扁,很好。但ListView項目不能再滾動。

2)android:windowSoftInputMode =「adjustResize」什麼都不做。

任何想法的人?

回答

3

在您的活動中使用getWindow()。setBackgroundDrawable()來設置背景。

0

使用android:windowSoftInputMode="adjustResize"並簡單地將背景包裹到ScrollView中的ImageView。

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