Я хочу создать макет, в котором 80% экрана содержит отдельный макет, а 20% содержит нижний лист по вертикали. Но когда я пытаюсь сделать это, он выдает мне ошибку «Представление не является дочерним элементом CoordinatorLayout». Я получил ошибку, но я не могу найти другой способ сделать это. Может кто-нибудь, пожалуйста, помогите мне достичь этого. Помощь будет оценена.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#efefef">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="5">
<include
layout="@layout/content_main_new"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4" />
<include
layout="@layout/content_bottom_sheet2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
content_bottom_sheet2.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/bottomSheetLayout"
android:layout_width="match_parent"
android:layout_height="230dp"
android:background="@color/colorPrimary"
android:orientation="vertical"
android:padding="@dimen/activity_vertical_margin"
app:behavior_peekHeight="90dp"
app:layout_behavior="@string/bottom_sheet_behavior">
<!--android:background="@android:color/holo_orange_light"-->
<android.support.v7.widget.CardView
android:id="@+id/cvBottomCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="@dimen/spIconsize"
android:visibility="visible"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="10dp"
app:cardElevation="5dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:paddingTop="10dp"
android:orientation="horizontal">
<Button
android:layout_marginBottom="5dp"
android:id="@+id/btnReview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_weight="1"
android:background="@drawable/rounded_button_darkgreen_bg"
android:text="Review"
android:textColor="@color/white" />
<Button
android:layout_marginBottom="5dp"
android:id="@+id/btnReschedule"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_weight="1"
android:background="@drawable/rounded_button_grey"
android:text="Reschedule"
android:textColor="@color/white" />
</LinearLayout>
<RelativeLayout
android:id="@+id/relLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/linearLayout"
android:layout_marginTop="5dp"
android:padding="10dp"
android:visibility="visible">
<ImageButton
android:id="@+id/imageButton"
android:layout_width="80dp"
android:layout_height="90dp"
android:src="@drawable/user"
android:visibility="gone" />
<TextView
android:id="@+id/tvappointmentId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/imageButton"
android:text="Appointment ID - 5727"
android:textColor="@color/black" />
<TextView
android:id="@+id/tvCustomerName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvappointmentId"
android:layout_toEndOf="@+id/imageButton"
android:text="Name - Virat Sharma"
android:textColor="@color/black" />
<TextView
android:id="@+id/tvLoanType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvCustomerName"
android:layout_toEndOf="@+id/imageButton"
android:text="Loan Type - Home LOAN" />
<TextView
android:id="@+id/tvLoanAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvLoanType"
android:layout_toEndOf="@+id/imageButton"
android:text="Loan Amount - 5727" />
<TextView
android:id="@+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/tvappointmentId"
android:layout_alignBottom="@+id/tvappointmentId"
android:layout_alignParentEnd="true"
android:gravity="right"
android:text="01:22 Mins"
android:textColor="@color/red_error"
android:textStyle="bold"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>