我使用的是水平滚动查看内部的循环器视图来显示像下面螺纹评论:RecyclerView HorizontalScrollView的Android内部
注释1 Comment1Child1 Comment1Child2 Comment1Child2Child1 Comment1Child3注释2
等
我使用以下XML完成了此操作:
<HorizontalScrollView
android:id="@+id/horizontalScrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:scrollbarSize="2dp">
<android.support.v7.widget.RecyclerView
android:id="@+id/commentRV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginLeft="47dp"
android:minWidth="200dp" />
</HorizontalScrollView>
您会看到我设置了200dp的最小宽度,以便评论永远不会太小,并且越靠近他们离线的线程越深。
它显示完美,但我无法水平滚动。我可以看到滚动条,但不能水平滚动。
我已经摆弄RV禁用Touch和nestedScrollingEnabled,但不知道真正的解决方案是什么。似乎没有任何工作?
任何帮助将不胜感激!谢谢
您可以简单地使用'LayoutManager'为'RecyclerView'。无需使用'HorizontalScrollView' – Piyush
@Piyush我正在使用LayoutManager,但我需要RV在HorizontalScroll内,否则它将无法工作 – SuperBale