简体   繁体   English

Android 按页滚动图像 - 哪个控件?

[英]Android scroll images by page - which control?

Im fairly new to andorid and getting to grips with the UI elements.我对 andorid 相当陌生,并且开始掌握 UI 元素。

I have a collection of full size images which i wish to be able to page through, horizontally, by scrolling left or right.我有一组完整尺寸的图像,我希望能够通过向左或向右滚动来水平翻页。

I do not want a scroll effect where you could see half of one image and half of the next, i want to page so only one full image is visible at any one time.我不想要滚动效果,您可以看到一张图像的一半和下一张图像的一半,我想要分页,以便在任何时候都只能看到一张完整的图像。

My question is, which control is best to achieve this?我的问题是,哪种控制最能实现这一目标?

Im currently thinking just an ImageView and handle a gesture to load in the next image.我目前只考虑一个 ImageView 并处理一个手势以加载下一个图像。 I have looked at the gallery but this seems to not suit what im trying to do.我看过画廊,但这似乎不适合我想要做的事情。 The lists will give a scroll, not a paged effect which i dont want.列表将提供滚动,而不是我不想要的分页效果。

Thanks!谢谢!

I think your are on the right track, but might want to put your ImageView into a ViewFlipper .我认为您走在正确的轨道上,但可能希望将您的 ImageView 放入ViewFlipper This will allow you to have a nice animated transition when you switch images.这将允许您在切换图像时获得漂亮的动画过渡。

You should also take a look at the PagedView widget from the GreenDroid library.您还应该查看GreenDroid库中的PagedView小部件。

ImageView with the gesture is probably the easiest way of doing this.带有手势的ImageView可能是最简单的方法。 See Adding Fling Gesture to an image view - Android for a reasonable example.有关合理示例,请参阅将 Fling Gesture 添加到图像视图 - Android

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM