如何使用Android ViewPager?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11643341/
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
How to use Android ViewPager?
提问by Steven
Possible Duplicate:
android viewPager implementation
可能的重复:
android viewPager 实现
Can someone please tell me how I can properly implement ViewPager into my project? I need to know what I can achieve by using it? I am somewhat new to programming and android. Basically I need to use horizontal paging for an app on which I am working on right now.
有人可以告诉我如何在我的项目中正确实施 ViewPager 吗?我需要知道使用它可以实现什么?我对编程和 android 有点陌生。基本上,我需要为我现在正在开发的应用程序使用水平分页。
I need step by step instruction guide for this.
为此,我需要分步说明指南。
回答by AkashG
Try this site - Page swiping using ViewPager
试试这个网站 -使用 ViewPager 进行页面滑动
This will help you to implement view pager step by step.
这将帮助您逐步实现视图寻呼机。
回答by Tsunaze
It's done automatically with the new ADT 20, you just need to choose "tabs+swipe" in the right section when you create a new Android application. Then you'll just have to create fragments, like the Dummy one they gave you for example.
它是使用新的 ADT 20 自动完成的,您只需在创建新的 Android 应用程序时在右侧部分选择“标签+滑动”。然后你只需要创建片段,比如他们给你的虚拟片段。