Android - 具有偶数图像的图库

发布于 2025-01-02 09:19:56 字数 225 浏览 2 评论 0原文

我在我的应用程序中使用 Gallery 对象,并且图像的大小使得画廊中一次的理想图像数量似乎是四个。三个导致空间过多,五个导致空间过小。

问题是画廊似乎专注于中心元素,因此我无法让四张图像在任何一次都适合屏幕上。即使我在释放触摸后立即手动滚动,布局也会调整,以便图像位于图库的中心。

我该如何修改这个?

PS:如果回复是“写你自己的画廊..”,我会很感激一些预先写好的画廊或来源的参考。

I am using a Gallery object in my app and the size of the images is such that four seems to be the ideal number of images in the gallery at one time. Three results in too much space and five in too little.

The problem is that the gallery seems to focus on the center element and therefore I can't get the four images to fit on screen and any one time. Even if I scroll by hand as soon as the release the touch the layout adjust so that an image is in the center of the gallery.

How can I amend this ?

P.S: If the reply is "Write your own gallery..", I'd appreciate references to some pre-written galleries or sources.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

美男兮 2025-01-09 09:19:56

我编写了自己的图库。事实上,它更像是一个类似于 iPhone 上使用的 PaginatedGallery

它是我的图书馆的一部分: https://github.com/sfarooq/PaginatedGallery

I wrote my own Gallery. In fact, it is more of a PaginatedGallery similar to the one used on iPhone.

Its part of my library at : https://github.com/sfarooq/PaginatedGallery

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