界面需求描述:界面顶部标题栏,中间可滑动视图,底部固定布局,中间可滑动的视图在标题栏下方和底部视图上方展现。
刚开始的视图文件布局大概如下:
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/liveGoodsAddRootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<include
android:id="@+id/titleLayout"
layout="@layout/layout_titleBar"
app:layout_constraintStart_toStartOf="parent"
/>
<androidx.core.widget.NestedScrollView
android:id="@+id/contentNestedScroll"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"

这篇博客讲述了在Android界面开发中,如何解决ConstraintLayout内嵌NestedScrollView显示异常的问题。作者通过调整NestedScrollView的android:layout_height为0dp,使其能够正确填充约束范围,并在标题栏和底部布局之间正常滑动。文章强调了ConstraintLayout的高效和灵活性。
8032

被折叠的 条评论
为什么被折叠?



