Fill viewport не работает в моей андроид студии xml - PullRequest
0 голосов
/ 10 октября 2018

Я использовал android:fillviewport="true" в моем xml, чтобы убрать пустое пространство внизу экрана, когда динамический текст был слишком маленьким, чтобы заполнить весь экран.

enter image description here

Но после того, как я немного изменил свой макет, android:fillviewport="true" больше не работает.Вот мой xml.Я пытался использовать fillviewport практически во всех контейнерах макетов, но безуспешно.Fillviewport ниже находится под Scrollview.

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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="com.nollvision.slothmode.nollvision.DetailActivity2">

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorPrimary"
    android:backgroundTint="@color/colorPrimaryDark"
    android:elevation="5dp"
    android:minHeight="?attr/actionBarSize"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />

<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">

<android.support.constraint.ConstraintLayout
    android:id="@+id/detail2_background"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorPrimary">

<all the children and the closing tags etc etc etc...
...