简体   繁体   English

实现一个可以垂直和水平滚动的列表

[英]Implementing a list that is both vertically & horizontally scrollable

I have a question related to Android app UI implementation. 我有一个与Android应用程序UI实施相关的问题。 The UI I want to implement is very similar to the Slideshare app UI, which I've attached below: 我要实现的UI与Slideshare应用程序UI非常相似,我在下面附加了该UI:

在此处输入图片说明

Apologies for the size of the image. 对于图片大小表示歉意。 But basically I want to implement a vertical list , and each item within the list is another horizontal list of sub-items . 但是基本上我想实现一个垂直列表 ,并且列表中的每个项目都是另一个水平的子项目列表

My current plan of approach is implementing a vertical RecyclerView , and then implementing each item of the list as a horizontal RecyclerView (basically a 2-Dimensional RecyclerView) . 我当前的方法计划是实现一个垂直RecyclerView ,然后将列表中的每个项目实现为一个水平RecyclerView (基本上是一个二维RecyclerView)

Am I on the right track here? 我在正确的轨道上吗? I apologise I cannot provide any code because I am still in the design phase . 对不起,我无法提供任何代码,因为我仍处于设计阶段 I do not want any code solutions but rather a guide or small tips as to how to approach implementing such UI. 我不需要任何代码解决方案,而是想要获得有关如何实现此类UI的指南或小技巧

Thank you for your time reading this question. 感谢您花时间阅读此问题。 Any tips would be highly appreciated! 任何提示将不胜感激!

You can use TwoWayView library to implement this scenario for bot horizontal and vertical listviews or you can use RecyclerView. 您可以使用TwoWayView库为bot水平和垂直列表视图实现此方案,也可以使用RecyclerView。

TwoWayView Library: https://github.com/lucasr/twoway-view/ TwoWayView库: https//github.com/lucasr/twoway-view/

TwoWayView Samples: https://github.com/lucasr/twoway-view/tree/master/sample TwoWayView示例: https//github.com/lucasr/twoway-view/tree/master/sample

You can read a great tutorial about how to implement this on on this Github page . 您可以在Github页面上阅读有关如何实现此功能的出色教程。

You can take a look at VerticalHorizontalListView and twoway-view and of course this link might be a help, which explains how to implement Dynamic Shelfview in Android. 您可以看一下VerticalHorizo​​ntalListViewtwoway-view ,当然此链接可能会有所帮助,它说明了如何在Android中实现Dynamic Shelfview。

I found this answer on SO : Horizontal ScrollView in List View Item Android which explains the issue prefectly, you can take a look at that too. 我在SO上找到了这个答案: Android的“列表视图项”中的Horizo​​ntal ScrollView可以完美地说明问题,您也可以查看一下。 I hope this links help you ;) 希望此链接对您有所帮助;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在网格布局中垂直和水平缩放图像 - Scale image both vertically and horizontally within a gridlayout 如何将整个视图(水平和垂直滚动)另存为图像或pdf? - how to save the whole view(horizontally and vertically scrollable) as image or pdf? 一次水平和垂直调整窗口(主机)的大小 - Resize window (main frame) both horizontally and vertically in one time 水平和垂直滚动。 如何在代码视图中显示Java代码并水平和垂直滚动代码? - Scrolling Both horizontally and vertically . how can i show my java code in a code view and scroll my code both horizontally and vertically? 如何在 android 工作室中垂直和水平填充图像数组 - How can I fill array of Images both vertically and horizontally in android studio 在Java中水平,垂直和对角(两个方向)搜索2D数组 - Searching through 2D array horizontally, vertically, and diagonally (both directions) in Java 水平和垂直调整TextArea的大小 - Resize TextArea horizontally and vertically 弹出水平居中但不垂直居中 - Popup centering horizontally but not vertically 使回收站视图可垂直滚动 - Make recycler view to be scrollable vertically 垂直和水平检查特定的JButton? - Checking vertically and horizontally for a specific JButton?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM