先看效果吧,在NestedScrollView控件里放布局,显示不全怎么办?
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorDefaultDark"
android:fillViewport="true"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.bbx.bmtc.views.NodataLayout
android:id="@+id/noDataLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.bbx.bmtc.views.scrollview.ObservableRecyclerView
android:id="@+id/pageList"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
解决办法: 添加如下两个属性
android:fillViewport="true"
android:overScrollMode="never"
不多说了,先见效果吧
是不是很神奇