大佬教程收集整理的这篇文章主要介绍了android – Recyclerview同时绑定所有视图,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
为了给你更多的信息,在我的布局文件中,我把回收器视图的高度设为wrap_content.
我认为问题是,由于有2个嵌套的垂直回收器,当父RV想要测量其孩子并且孩子是另一个RV时,在onMeasure()中,它计算整个RV所需的大小,而不仅仅是它的部分想绑定在屏幕上.
任何想法如何解决?
这是我的外部回收器视图的布局文件:
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://scheR_685_11845@as.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:id="@+id/component_list" android:layout_width="match_parent" android:layout_height="match_parent"/> </FrameLayout>
这里是我内部回顾者视图的代码:
<LinearLayout xmlns:android="http://scheR_685_11845@as.android.com/apk/res/android" android:id="@+id/container" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="@dimen/gutter" android:paddingBottom="@dimen/gutter"> <TextView android:id="@+id/title_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/gutter" android:textSize="30sp" android:textColor="@android:color/white" android:fontFamily="sans-serif-thin"/> <android.support.v7.widget.RecyclerView android:id="@+id/my_slider" android:layout_width="match_parent" android:layout_height="wrap_content"/> </LinearLayout>
P.S .:我正在使用这个适配器委托作为我的外部回收器视图:
https://github.com/sockeqwe/AdapterDelegates
以上是大佬教程为你收集整理的android – Recyclerview同时绑定所有视图全部内容,希望文章能够帮你解决android – Recyclerview同时绑定所有视图所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。