建议如何实施图像幻灯片/轮播?( iOS )

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15765758/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 22:59:51  来源:igfitidea点击:

Advise on how to implement image slideshow/carousel? ( iOS )

iphoneiosobjective-cxcodeslideshow

提问by Dave

I've just started out with iOS development and I'm building an app to help myself learn faster.

我刚刚开始使用 iOS 开发,我正在构建一个应用程序来帮助自己更快地学习。

I've gotten to the stage where I have all the basics of the app nailed down but now I just want to implement a slideshow at the top of my view controller like the one found in the National Parks app and many other apps too - http://wpuploads.appadvice.com/wp-content/uploads/2012/04/Nati2.jpg

我已经到了这个阶段,我已经掌握了应用程序的所有基础知识,但现在我只想在我的视图控制器顶部实现一个幻灯片,就像在 National Parks 应用程序和许多其他应用程序中找到的一样 - http ://wpuploads.appadvice.com/wp-content/uploads/2012/04/Nati2.jpg

Any advise or links to tutorials or explanations would be great. Thanks

任何建议或教程或解释的链接都会很棒。谢谢

采纳答案by Ganapathy

I Hope this link will help u

我希望这个链接能帮助你

http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content

http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content

Other simple way to achieve: Steps to achieve

其他简单实现方式:步骤实现

  1. Add all the images in one scroll view.

  2. Enable paging for that scroll view.

  3. Based on the content offset of the scroll view highlight the appropriate dot(indicator in the bottom).

  1. 在一个滚动视图中添加所有图像。

  2. 为该滚动视图启用分页。

  3. 基于滚动视图的内容偏移突出显示适当的点(底部的指示器)。

回答by user2186457

you have to download iCarousel code from github https://github.com/nicklockwood/iCarousel. you can download code from here.

你必须从 github https://github.com/nicklockwood/iCarousel下载 iCarousel 代码。你可以从这里下载代码。

回答by DevC

You could also use a UICollectionViewwith horizontal scrolling.

您也可以使用UICollectionView水平滚动。