У меня есть макет ограничения и внутри линейного макета, который выглядит как полоса, которая ограничена снизу. Кроме того, у меня есть элемент (называемый SwipeFlingAdapterView), который я хотел бы занять оставшееся пространство, то есть начать с вершины и до go вплоть до верха линейной линейной разметки:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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=".fragments.SwipeFragment">
<LinearLayout
android:id="@+id/likeDislikeBar"
android:layout_width="match_parent"
android:layout_height="@dimen/like_dislike_height"
android:gravity="bottom"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent">
<ImageButton
android:id="@+id/dislikeButton"
android:layout_width="0dp"
android:layout_height="@dimen/like_dislike_button_height"
android:layout_weight="1"
android:background="@null"
android:src="@drawable/dislike"
android:layout_gravity="center_vertical"
android:scaleType="centerInside"/>
<ImageButton
android:id="@+id/likeButton"
android:layout_width="0dp"
android:layout_height="@dimen/like_dislike_button_height"
android:layout_weight="1"
android:background="@null"
android:src="@drawable/like"
android:layout_gravity="center_vertical"
android:scaleType="centerInside"/>
</LinearLayout>
<com.lorentzos.flingswipe.SwipeFlingAdapterView
android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/likeDislikeBar"
app:rotation_degrees="15.5"/>
</androidx.constraintlayout.widget.ConstraintLayout>
Представления ограничены правильно, поэтому теоретически, если я удалю height = "match_parent" из SwipeFlingAdapterView, он займет доступное пространство. Установка его высоты в «match_parent» приведет к тому, что он наложится на likeDislikeBar.
Есть ли простой способ добиться этого? Могу ли я сделать это с макетом ограничения?