Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recycylerview数据比较大的时候,数据直接无法显示(106),降低数据量就可以(30条)。需要优先配置什么参数吗? #139

Open
shalang312 opened this issue Oct 8, 2021 · 6 comments

Comments

@shalang312
Copy link

No description provided.

@dkzwm
Copy link
Owner

dkzwm commented Oct 9, 2021

你可以尝试移除SRL进行排查,理论上应该和SRL没啥关系,应该是你RV布局或者配置问题

@shalang312
Copy link
Author

    <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>

@shalang312
Copy link
Author

上面是我的整体布局,感觉没有什么问题。 配置的话基本没写什么配置操作。

@dkzwm
Copy link
Owner

dkzwm commented Oct 9, 2021

和SRL无关,你用NestedScrollView嵌套RecyclerView且动态加载数据,那么请自行触发重布局,否则布局高度不会发生变化数据无法展示。

@shalang312
Copy link
Author

请问需要如何设置才能触发重布局?

@shalang312
Copy link
Author

TestRecyclerViewInNestedScrollViewActivity 你的demo里面这个页面,也是这样布局的,我看页面里面没什么特殊配置操作,只有一个进页面自动刷新。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants