我正在尝试创建一个非常基本的聊天屏幕,其中ListView显示文本,底部是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>
Run Code Online (Sandbox Code Playgroud)
android android-manifest android-layout android-softkeyboard