Android 相对布局底部的布局覆盖其下的视图
我的屏幕由四个主要视图组成: 1admob视图 2顶部布局 3中央的CrollView,以编程方式填充 4底部视图。EditView高度可在其中展开 问题是底部视图覆盖了scrollView的内容。 也就是说,scrollView不会在底部布局的开始处结束 该网站禁止我发送大量代码,因此我发送短xmlAndroid 相对布局底部的布局覆盖其下的视图,android,android-layout,android-edittext,android-relativelayout,Android,Android Layout,Android Edittext,Android Relativelayout,我的屏幕由四个主要视图组成: 1admob视图 2顶部布局 3中央的CrollView,以编程方式填充 4底部视图。EditView高度可在其中展开 问题是底部视图覆盖了scrollView的内容。 也就是说,scrollView不会在底部布局的开始处结束 该网站禁止我发送大量代码,因此我发送短xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.andr
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<include layout="@layout/adview"
android:layout_alignParentTop="true"
/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal|center_vertical"
android:orientation="horizontal"
android:layout_below="@+id/adView"
>
<TextView
android:id="@+id/textChatSubjectTitle"
android:text='Subject'
android:layout_width="wrap_content"
android:layout_weight="5"
android:layout_height="wrap_content"
/>
<ImageView
android:id="@+id/imageChatImageTitle"
android:layout_height="fill_parent"
android:layout_width="wrap_content"
/>
</LinearLayout>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollChat"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/backNormal"
android:orientation="vertical"
android:layout_below="@+id/top"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearChat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
</LinearLayout>
</ScrollView>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
>
<ImageView
android:id="@+id/buttonClip"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity= "center_vertical|center_horizontal"
/>
<EditText
android:id="@+id/editChatMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:inputType="textMultiLine|textCapSentences"
android:minLines="1"
android:gravity="top|left"
android:maxLines="5"
android:maxLength="500"
android:layout_marginRight="5dp"
android:layout_weight="5"
android:scrollHorizontally="false"
/>
<Button
android:id="@+id/buttonChatSend"
android:text='send'
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/darkGray"
/>
</LinearLayout>
</RelativeLayout>
有什么想法吗?
谢谢 试试这个。我给了你的底部面板一个id,然后在你的ScrollView上面添加了一个android:layout_标记。我还根据收到的线头警告进行了清理:
<?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">
<include layout="@layout/adview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"/>
<LinearLayout
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/adView"
android:gravity="center_horizontal|center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/textChatSubjectTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text="Subject"/>
<ImageView
android:id="@+id/imageChatImageTitle"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
</LinearLayout>
<ScrollView
android:id="@+id/scrollChat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/bottomPanel"
android:layout_below="@+id/top"
android:background="@color/backNormal"
android:orientation="vertical">
<LinearLayout
android:id="@+id/linearChat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</ScrollView>
<LinearLayout android:id="@+id/bottomPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<ImageView
android:id="@+id/buttonClip"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_weight="1"/>
<EditText
android:id="@+id/editChatMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_weight="5"
android:gravity="top|left"
android:inputType="textMultiLine|textCapSentences"
android:maxLength="500"
android:maxLines="5"
android:minLines="1"
android:scrollHorizontally="false"/>
<Button
android:id="@+id/buttonChatSend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="send"
android:textColor="@color/darkGray"/>
</LinearLayout>
</RelativeLayout>
对非常感谢你!但我不明白你做了什么:我还根据收到的线头警告清理了东西: