реализация макета ограничения в scrollview - PullRequest
0 голосов
/ 27 сентября 2018

представление прокрутки не работает при реализации, как этоне работает даже текстовое представление больше не видно, как я могу это исправить

Ответы [ 3 ]

0 голосов
/ 27 сентября 2018

На самом деле, ваш код должен работать, когда имеется достаточно элементов для прокрутки, попробуйте добавить более высокий отступ для текстового представления, и вы увидите результат:

<?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"
    android:gravity="center_horizontal"
    tools:context=".MainActivity">

    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.constraint.Guideline
            android:id="@+id/guideline"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_marginTop="630dp"
            android:layout_marginBottom="32dp"
            android:orientation="horizontal"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintGuide_percent="1.0"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/textView"
            android:layout_width="wrap_content"
            android:layout_height="22dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="600dp"
            android:layout_marginEnd="8dp"
            android:layout_marginBottom="8dp"
            android:text="TextView"
            app:layout_constraintBottom_toBottomOf="@id/guideline"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="1.0" />


    </android.support.constraint.ConstraintLayout>
</ScrollView>
0 голосов
/ 27 сентября 2018

добавьте приведенный ниже линейный макет в представление прокрутки и добавьте свой макет ограничения в этот линейный макет

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" />

я думаю, что это будет работать

0 голосов
/ 27 сентября 2018

Можете ли вы попробовать с BottomSheet ?

enter image description here

...