Разверните материал EditText в режиме прокрутки, чтобы заполнить высоту в Android - PullRequest
0 голосов
/ 30 мая 2020

У меня есть файл макета, как показано ниже. Я хочу description_layout (TextInputLayout), чтобы заполнить оставшуюся высоту экрана до нижней части экрана, если list просмотр ресайклера не содержит каких-либо / достаточно элементов.

Как я могу добиться этого, сохраняя вид прокрутки на всем inner_layout.

В текущем состоянии вид выглядит примерно так:

Current Layout View

<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">


<androidx.constraintlayout.widget.ConstraintLayout
    android:id="@+id/fragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fillViewport="true"
        app:layout_constraintTop_toBottomOf="@id/mytoolbar">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/inner_layout">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/list"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constrainedHeight="true"
                app:layout_constraintBottom_toTopOf="@+id/description_layout"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/title_layout" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/title_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Title"
                android:scrollbars="vertical"
                app:layout_constraintBottom_toTopOf="@+id/list"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />

            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/description_layout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:hint="Content"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/list">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/description"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_gravity="top|start"
                    android:gravity="top|start"
                    android:minLines="5" />

            </com.google.android.material.textfield.TextInputLayout>
        </androidx.constraintlayout.widget.ConstraintLayout>
    </ScrollView>


    <com.google.android.material.appbar.MaterialToolbar
        android:id="@+id/mytoolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        app:layout_constraintTop_toTopOf="parent"
        app:navigationIcon="@drawable/ic_arrow_back_white_24dp"
        app:title="Toolbar Title" />
</androidx.constraintlayout.widget.ConstraintLayout>

- Заранее спасибо!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...