我正在嘗試創建一個非?;镜牧奶炱聊唬渲械腖istView在底部顯示文本,EditText,并在EditText的右側顯示“發送”按鈕。一切正常,但是當我單擊EditText時,虛擬鍵盤將其覆蓋。屏幕略微平移,但不足以在鍵盤上方可見。我的清單中有“ adjustPan”標簽,也嘗試了“ adjustResize”標簽無濟于事。我猜想這與我的布局設置方式有關,但老實說我沒有任何線索。請幫忙!當前布局...<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"><ListView android:id="@+id/android:list" android:layout_height="0dip" android:layout_width="fill_parent" android:layout_weight="1" android:stackFromBottom="true"></ListView><LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/sendMessageBox" android:focusable="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:scrollbars="vertical" android:maxLines="4" android:text="" android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine" android:maxLength="1000" android:hint="Type your message..." android:imeOptions="actionSend"/> <Button android:id="@+id/sendMessageButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" android:text="Send"/></LinearLayout>
3 回答

汪汪一只貓
TA貢獻1898條經驗 獲得超8個贊
經過大量搜索之后,這就是我所說的錯誤。如果使用全屏標記(要從活動中刪除狀態欄),則不將活動包裝在ScrollView中就不能使用“ adjustResize”。不幸的是,我正在使用ListView,這會帶來另一個問題。我討厭把它弄亂了,可能會放棄該活動的全屏顯示。

郎朗坤
TA貢獻1921條經驗 獲得超9個贊
如果您android:windowSoftInputMode="adjustResize" 在清單中設置了活動,則ScrollView(或其他可折疊的ViewGroup)將縮小以容納軟鍵盤。但是,如果您android:windowFullscreen="true"在活動的主題中進行設置,則ScrollView不會縮小,因為它被迫填滿整個屏幕。但是,android:fitsSystemWindows="false"在主題中設置也會導致AdjustResize不起作用
- 3 回答
- 0 關注
- 375 瀏覽
添加回答
舉報
0/150
提交
取消