纵“的GridView与网页”或“Viewpager” [英] Vertical 'Gridview with pages' or 'Viewpager'
问题描述
我在功能上需要的是一个垂直ViewPager与GridView控件
。
因此, ViewPager
应该有一个 GridView控件
,而 ViewPager $ C的每一页$ C>是水平的。
What I functionally need is a Vertical ViewPager with GridView
.
So every page of the ViewPager
should have a GridView
, but the ViewPager
is horizontal.
因此,有两种可能:
So there are two possibilities:
- 旋转与GridView的的ViewPager
- 创建一个GridView,显示在页面的项目
GridView控件应显示0-20当用户滚动20-40等等等等。
The GridView should show 0-20 when the user scrolls 20-40 etc etc.
有没有人有办法解决这个?
Does anyone have a solution for this?
我已经检查此链接,但我不能用它事业的法律原因。
I have checked this link, but I cannot use it cause of legal reasons.
推荐答案
听起来像是你真正需要的是一个垂直的ViewPager。虽然Android的只是提供了一个水平的,没有什么是prevents你自己实现它。获得<一个href=\"http://$c$c.google.com/p/openintents/source/browse/trunk/compatibility/AndroidSupportV2/src/android/support/v2/view/ViewPager.java?r=3488\"相对=nofollow> ViewPager源$ C $ C 并修改它来检测刷卡向上/向下,而不是左/右。源是根据Apache 2.0许可分布,因此,你有充分的权利,而无需分发它的源创作衍生作品。
Sounds like what you really need is a vertical ViewPager. Although Android only provides a horizontal one, there's nothing that prevents you from implementing it yourself. Get the ViewPager source code and modify it to detect swipes up/down instead of left/right. The source is distributed under Apache 2.0 license, therefore you have full rights to create derivative works without having to distribute the source of it.
有将是非常少数地方改变,具体地,涉及到计算滑动方向/斜率的方法(上/代替向下的左/右)和(使用高度代替下面各宽度与布局页有关布局计算方法其他)。
There will be very few places to change, specifically, methods related to computing the swipe direction/slope (up/down instead of left/right) and methods related to layout computation (using height instead of width and layout pages below each other).
这篇关于纵“的GridView与网页”或“Viewpager”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!