【发布时间】:2014-10-28 21:48:48
【问题描述】:
清单
<activity
android:name="com.example.Thread"
android:label="Thread"
android:windowSoftInputMode="adjustPan"
android:parentActivityName="com.example.Home" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.Home" />
</activity>
布局 XML 文件
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e3e3e3"
android:orientation="vertical" >
<View
android:id="@+id/view2"
android:layout_width="match_parent"
android:layout_height="4dp"
android:background="@color/green_line" />
<RelativeLayout
android:id="@+id/bottom_layout"
android:layout_width="match_parent"
android:layout_height="55dp"
android:background="#f0eeec"
android:layout_alignParentBottom="true" >
<ImageView
android:id="@+id/camera"
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:padding="16dp"
android:src="@drawable/camera" />
<ImageView
android:id="@+id/send"
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:padding="12dp"
android:src="@drawable/abc_ic_go_search_api_holo_light" />
<EditText
android:id="@+id/chatContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/send"
android:layout_toRightOf="@+id/camera"
android:ems="10" />
</RelativeLayout>
<ListView
android:id="@+id/chatThread"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/bottom_layout"
android:layout_below="@+id/view2"
android:divider="@null"
android:dividerHeight="0dp"
android:layout_centerHorizontal="true" >
</ListView>
当用户调用软键盘时,它与列表视图重叠,因此底部项目被相同的隐藏。如果我给android:windowSoftInputMode="adjustPan" Listview 到键盘但也隐藏操作栏。
我需要列表视图上升,但 ActionBar 应该保持在顶部。我怎样才能实现呢?如果需要更多说明,请发表评论。
【问题讨论】:
-
请注意 android:windowSoftInputMode="adjustResize" 不起作用。我也试过了