ScrollView里面没有使用ConstraintLayout滚动

时间:2018-01-08 21:23:22

标签: android scrollview android-constraintlayout

当我的设备进入横向模式时,我的布局不会滚动。我已经看到了其他一些问题,但大多数都是略微不相关或者谈论过去已经修复过的错误。

我知道有一个错误导致我使用fillViewport = true。我不确定这是否会产生影响或是否有其他想法?

我用

尝试了这个
compile 'com.android.support.constraint:constraint-layout:1.0.2'



 <?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:fillViewport="true"
      tools:context=".MainActivity">

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

       <RelativeLayout
        android:id="@+id/fragment_container"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@+id/navigation_view"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent">


        <android.support.v7.widget.Toolbar
            android:id="@+id/my_awesome_toolbar"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            android:background="?attr/colorPrimary"
            android:minHeight="?attr/actionBarSize"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
            app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>

              <!-- edited out -->

    </RelativeLayout>

    <android.support.design.widget.BottomNavigationView
        android:id="@+id/navigation_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:menu="@menu/bottom_navigation_main" />

    </android.support.constraint.ConstraintLayout>
  </ScrollView>

0 个答案:

没有答案