Android - ListView 的项目填满整个屏幕?
我正在做一个简单的测验应用程序,其中包含用户回答的几个问题。问题是列表中的一个项目,但它需要占据整个屏幕。当用户回答时,他会在屏幕上滑动手指以转到下一个/上一个问题。
这可以通过内置视图/方法来完成吗?我希望我说得足够清楚。
I am doing a simple Quiz application that has several questions that the user answers. A question would be an item in the list but it would need to occupy the entire screen. When the user answers he would swipe his fingers over the screen to go to the next/previous question.
Can this be done with a build-in view/method? I hope I am being clear enough.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可以!您需要的是 ViewPager,它可以作为兼容性包的一部分。这个类允许您创建多个页面并在它们之间滚动。这些页面可以使用片段创建。 这篇关于水平滑动的博文有关如何完成您所需的基本信息,您还可以查看示例。
It can! What you need is the ViewPager, it is available as a part of the compatibility package. This is a class which allows you to create several pages and scroll between them. These pages can be created using fragments. This blog post on horizontal swiping has the basic information on how to accomplish what you need, you can also have a look at the examples.
可能 Gallery 是合适的,它可以处理多个项目的滑动。它不仅适用于图片:)。
Probably a Gallery is appropriate, which can handle swiping through several items. It does not only work for pictures :).