SmoothRefreshLayout
SmoothRefreshLayout copied to clipboard
recycylerview数据比较大的时候,数据直接无法显示(106),降低数据量就可以(30条)。需要优先配置什么参数吗?
你可以尝试移除SRL进行排查,理论上应该和SRL没啥关系,应该是你RV布局或者配置问题
<LinearLayout android:id="@+id/root" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
<include
android:id="@+id/inxlude_title"
layout="@layout/include_conversation_toolbar" />
<me.dkzwm.widget.srl.ClassicSmoothRefreshLayout
android:id="@+id/refreshlayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.bryan.hc.htsdk.ui.test2.DragView
android:id="@+id/dragView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
dragView:column="6"
dragView:horizontal_padding="@dimen/d1.0"
dragView:ratio="1"
dragView:vertical_padding="@dimen/d8.0">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:visibility="gone">
<TextView
android:id="@+id/tvButton"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:gravity="center_vertical"
android:paddingLeft="12dp"
android:text="我的定制内容"
android:textColor="#ff000000"
android:textSize="16dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:gravity="center_vertical"
android:paddingRight="12dp"
android:text="(长按可以拖动,点击则删除)"
android:textColor="#ff000000"
android:textSize="12dp" />
</RelativeLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:paddingLeft="12dp"
android:text="点击增加内容"
android:textColor="#ff000000"
android:textSize="16dp"
android:visibility="gone"/>
</com.bryan.hc.htsdk.ui.test2.DragView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvConversation"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</me.dkzwm.widget.srl.ClassicSmoothRefreshLayout>
</LinearLayout>
上面是我的整体布局,感觉没有什么问题。 配置的话基本没写什么配置操作。
和SRL无关,你用NestedScrollView
嵌套RecyclerView
且动态加载数据,那么请自行触发重布局,否则布局高度不会发生变化数据无法展示。
请问需要如何设置才能触发重布局?
TestRecyclerViewInNestedScrollViewActivity 你的demo里面这个页面,也是这样布局的,我看页面里面没什么特殊配置操作,只有一个进页面自动刷新。