【发布时间】:2014-12-10 17:16:05
【问题描述】:
我正在创建聊天应用程序,在聊天屏幕中我有标题布局(包括)、列表视图和页脚布局(包括)。
当我点击屏幕压缩的编辑文本背景时,感觉很丑。我在清单中使用了"android:windowSoftInputMode="stateAlwaysHidden|adjustPan" 语句,现在背景没有压缩,但我的整个屏幕向上推,这导致我的标题现在不可见。
任何想法,通过它不压缩背景以及标题将保留在屏幕上
我的屏幕 xml 是:``
<include
android:id="@+id/header"
layout="@layout/message_header_unlocked"
android:focusable="true"
/>
<RelativeLayout
android:id="@+id/list_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/footer"
android:layout_below="@+id/header"
android:background="@drawable/main_bg" >
<include
android:id="@+id/attachLayout"
layout="@layout/attachment_view"
android:visibility="gone" />
<ListView
android:id="@+id/msgList"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/attachLayout"
android:layout_marginBottom="2dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="0dp"
android:divider="@null"
android:dividerHeight="0dp"
android:listSelector="@android:color/transparent" />
</RelativeLayout>
<include
android:id="@+id/footer"
android:layout_alignParentBottom="true"
android:layout_below="@+id/list_layout"
layout="@layout/message_footer" />
``
【问题讨论】: