ScrollView在android中不会滚动到底部
我知道这个问题在这里被问了很多次,但没有一个解决方案对我有帮助。我确实尝试过将边距改为填充,它确实会滚动,但是我无法以正确的方式定位按钮。 以下是xml:ScrollView在android中不会滚动到底部,android,android-scrollview,android-constraintlayout,android-nestedscrollview,Android,Android Scrollview,Android Constraintlayout,Android Nestedscrollview,我知道这个问题在这里被问了很多次,但没有一个解决方案对我有帮助。我确实尝试过将边距改为填充,它确实会滚动,但是我无法以正确的方式定位按钮。 以下是xml: 仔细观察工具栏代码: <android.support.v7.widget.Toolbar android:id="@+id/about_us_toolbar" android:layout_width="0dp" android:layout_height="wrap_content"
仔细观察工具栏代码:
<android.support.v7.widget.Toolbar
android:id="@+id/about_us_toolbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:popupTheme="@style/AppTheme.PopupOverlay" />
这将导致工具栏在父工具栏内居中。由于滚动视图被限制在工具栏下方,因此在滚动顶部接触顶部工具栏后,它无法滚动所有内容
删除此约束:
app:layout_constraintBottom_toBottomOf="parent"
现在,您的新工具栏代码将是:
<android.support.v7.widget.Toolbar
android:id="@+id/about_us_toolbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:popupTheme="@style/AppTheme.PopupOverlay" />
产出2:
您找到解决方案了吗?在您的示例中,您仍然有app:layout\u constraintBottom\u toBottomOf=parent,但您说要删除它。。无论如何,它对我没有任何帮助,我对工具栏没有这个约束,对于工具栏,我只是使用了宽度匹配(width match)和高度换行(height wrap)内容,仍然无法滚动到底部来修复,我只需要用LinearLayout替换ConstraintLayout,只有ScrollView有子ConstraintLayout,所以只有一个ConstraintLayout没有两个,当它不能正确使用ConstraintLayout>ScrollView>ConstraintLayout时,看起来像是Android的Bug
<android.support.v7.widget.Toolbar
android:id="@+id/about_us_toolbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:popupTheme="@style/AppTheme.PopupOverlay" />