У меня есть CardView, который я помещаю в представление переработчика. Представление карты, которое я делаю, не имеет разрыва между собой, хотя я уже добавил поля и отступы. также текст находится вне поля зрения карты.
Это результат моего кода, текст за пределами экрана и нет пропуска между просмотром карты:
Это список xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView 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="120dp"
android:layout_margin="5dp">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tv_sales_invoice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="invoice"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_sales_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="date"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_sales_invoice" />
<View
android:id="@+id/top_line"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="5dp"
android:background="@color/colorBlack"
app:layout_constraintTop_toBottomOf="@+id/tv_sales_date" />
<TextView
android:id="@+id/sales_itemname_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="@string/item_name"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/top_line" />
<TextView
android:id="@+id/sales_itemqty_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/item_qty"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@+id/sales_itemname_header"
app:layout_constraintRight_toRightOf="@+id/sales_itemprice_header"
app:layout_constraintTop_toTopOf="@+id/sales_itemname_header" />
<TextView
android:id="@+id/sales_itemprice_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/item_price"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/sales_itemname_header" />
<View
android:id="@+id/mid_line"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/colorBlack"
app:layout_constraintTop_toBottomOf="@+id/sales_itemname_header" />
<TextView
android:textAlignment="textStart"
android:id="@+id/tv_sales_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="item"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="@+id/sales_itemname_header"
app:layout_constraintRight_toRightOf="@+id/sales_itemname_header"
app:layout_constraintTop_toBottomOf="@+id/sales_itemname_header" />
<TextView
android:id="@+id/tv_sales_qty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="qty"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="@+id/sales_itemqty_header"
app:layout_constraintRight_toRightOf="@+id/sales_itemqty_header"
app:layout_constraintTop_toBottomOf="@+id/sales_itemqty_header" />
<TextView
android:textAlignment="viewEnd"
android:id="@+id/tv_sales_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/price"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="@+id/sales_itemprice_header"
app:layout_constraintRight_toRightOf="@+id/sales_itemprice_header"
app:layout_constraintTop_toBottomOf="@+id/sales_itemprice_header" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
это макет представления переработчика:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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"
tools:context=".SalesHistoryActivity">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tv_sales_history"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sales_history"
android:textSize="25dp"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent" />
<android.support.v7.widget.RecyclerView
android:id="@+id/sales_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="10dp"
android:nestedScrollingEnabled="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_sales_history"></android.support.v7.widget.RecyclerView>
</android.support.constraint.ConstraintLayout>
</ScrollView>