eclipse 滚动视图在android中分页

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8398507/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:25:07  来源:igfitidea点击:

Scrollview with paging in android

androideclipsesdkpaginationscrollview

提问by user1083284

is there a simple/native way to implement paging/pagination on scrollviews? By simple, I mean with a short piece of code mainly using classes from Android SDK, like, when programming on iPhone, writing "pagingEnabled = YES".

有没有一种简单/本机的方法来在滚动视图上实现分页/分页?简单来说,我的意思是用一小段代码主要使用 Android SDK 中的类,例如,在 iPhone 上编程时,编写“pagingEnabled = YES”。

When I was looking for the topic on the Internet, I saw people putting pieces of code about that matter, but these pieces of code were very large, and I can't help myself to believe Google did put a simple way to do it in their SDK. I also think that the code to implement it could be much easier than what I saw when looking for it. I'm currently working on it, but in the meantime, if anyone know a easier way to do it, I would be delighted to know about it.

我在网上找话题的时候,看到有人贴了一段关于那件事的代码,但是这些代码非常大,我不禁相信谷歌确实在里面放了一个简单的方法他们的 SDK。我还认为实现它的代码可能比我在寻找它时看到的要容易得多。我目前正在研究它,但与此同时,如果有人知道更简单的方法,我会很高兴知道它。

Thanks for reading!

谢谢阅读!

采纳答案by oriolpons

I think that there is not a fast solution to do this.

我认为没有一个快速的解决方案来做到这一点。

But what you can do is to take the gallery component and override the layout. The gallery component has paging :)

但是您可以做的是获取图库组件并覆盖布局。画廊组件有分页:)

Another solution could be:

另一种解决方案可能是:

Horizontal Pager - https://github.com/ysamlan/horizontalpager

水平寻呼机 - https://github.com/ysamlan/horizo​​ntalpager

Real View Switcher http://marcreichelt.blogspot.com/2010/09/android-use-realviewswitcher-to-switch.html

实景切换器http://marcreichelt.blogspot.com/2010/09/android-use-realviewswitcher-to-switch.html

Hope this helps...

希望这可以帮助...