一屏中的三个列表视图
我在 iPhone 上有一个应用程序,采用如图所示的层叠设计,我想将其移植到 Android 上。有没有简单且推荐的方法来做到这一点?
左侧的部分菜单(A、B、C、D 部分)是用户需要首先选择的,然后用户需要选择中间的类别(全部、流行、pc、xbox,...) ,然后他会看到所选类别的文章列表。
我可以想象使用三个 ListView 来完成此操作,但应用程序还可以监听滑动手势以使最右边的 ListView “全屏”,并隐藏前两个列表视图。我可以为整个活动实现一个滑动侦听器,并将前两个列表视图的可见性设置为隐藏,对吗?
我的假设正确吗?这是正确的方法吗?
I have an app on iPhone with cascading design like on the picture, and I'd like to port it to Android. Is there a simple and recommended way to do this?
The section menu on the left (Section A, B,C,D) is the first that the user needs to select, then the user needs to pick a category in the middle (all, popular, pc, xbox,...), then he is presented with a list of articles for chosen category.
I could imagine doing it with three ListViews, but then the app could also listen to a swipe gesture to make the rightmost ListView "full screen", and hide the first two listviews. I could implement a swipe listener for the whole activity and set first two listviews' visibility to hidden, right?
Are my assumptions correct and would this be the right way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它绝对可以按照你解释的方式工作——如果设计好那就是另一个讨论了。 ,当空间像大多数手机一样有限时,我不喜欢在一个屏幕上投入无穷无尽的数据(我可能会使用 3 个不同的屏幕,每个屏幕上都有一个 ListView)
就我个人而言 滑动手势是可行的,您当然可以使用函数
setVisibility( View.GONE )
隐藏其他两个 ListView。希望有帮助。
It could definetly work the way you explain it - if the design is good is another discussion. Personally I'm not a fan of throwing in endless amounts of data in one screen, when the space is as limited as it is on most mobile phones (I would probably do it with 3 different screens with a ListView on each)
Implementing the mentioned swipe gesture is doable and you could certainly just hide the two other ListViews with the function
setVisibility( View.GONE )
.Hope it helps.
LinearLayout
) and do the swipe listening there. However, achieving a finger-tracking animation (i.e. where the rightmost pane follows the finger precisely as it swipes across) is a pretty daunting task (I wouldn't really know where to begin, probably in the custom view though). The best way (I think) to do it is to make a compromise and just start an animation (right-to-left slide) when you detect a swipe. However, the simplest solution is to not animate at all.