Android - ListView 的项目填满整个屏幕?

发布于 2025-01-04 19:23:01 字数 127 浏览 2 评论 0原文

我正在做一个简单的测验应用程序,其中包含用户回答的几个问题。问题是列表中的一个项目,但它需要占据整个屏幕。当用户回答时,他会在屏幕上滑动手指以转到下一个/上一个问题。

这可以通过内置视图/方法来完成吗?我希望我说得足够清楚。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心安伴我暖 2025-01-11 19:23:01

可以!您需要的是 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.

往日情怀 2025-01-11 19:23:01

可能 Gallery 是合适的,它可以处理多个项目的滑动。它不仅适用于图片:)。

Probably a Gallery is appropriate, which can handle swiping through several items. It does not only work for pictures :).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文