android 中相对布局的分页
我以编程方式创建按钮并将它们添加到相对布局中,其父级是 HorizontalScrollView,
有时布局会变得非常长,如果有一个分页器按钮可以从项目 #1 跳转到项目 1 页,那就太好了...
是有什么方法可以帮助我将项目 i 放入布局可见部分的插槽 #1 中?
如果可以的话,我可以将我的模型调整为 LinearLayout。
谢谢!
I programmatically create buttons and add them into a relativelayout, whose parent is a HorizontalScrollView,
Occasionally the layout becomes really long and it would be nice to have a pager button that would jump from item #1 to the items 1 page over...
Is there any method(s) that would help me in placing an item i into slot #1 in the visible portion of the layout?
I can adjust my model to a LinearLayout if it's an option.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我了解,您正在尝试在一组按钮之间切换。
在按钮组之间切换的一种方法是使用取景器。将一组按钮保持线性布局。因此,当您想翻转到下一组时,请使用
另一种方法是使用视图分页器。使用视图分页器将允许您通过滑动来切换布局。
这可能有用,它是 关于分页的博客文章。 这里是源代码。
From my understanding you are trying to flip between a group a buttons.
One way to flip between group of buttons would be to use a viewflipper. Keep a group of buttons in a linear layout. So when you want to flip to the next group use the
Another way would be to use the viewpager. Using the view pager will allow you to flip between layout by just sliding.
This might be of use, it is a blog post about pagination. And here is the source code.