xcode 实现 CoverFlow 视图

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

Implementing a CoverFlow View

iosxcodecoverflow

提问by Giovanni Filaferro

I have to create a view where I have to put in a CoverFlow of Images. How can I crete it? There would be images with labels that can explain the image.

我必须创建一个视图,我必须在其中放入图像的 CoverFlow。我怎么能把它弄脏?会有带有标签的图像可以解释图像。

回答by AliSoftware

There are plenty of ways to do it

有很多方法可以做到

  • If you application is iOS6+ only and don't need to support iOS5, you can use UICollectionViewto implement it. You will need to build some custom layout -- see session 219 of WWDC'12 hereafter you have logged in using your Apple ID. You can also find plenty of tutorials on the net, simply google for the UICollectionViewkeyword.
  • If you need to support iOS5 or earlier, or if you don't want to build your own custom UICollectionViewLayout, you can use some of the already made classes -- there are a lot of them around on the net. One of the most famous being iCarousselon github, which is free, compatible with multiple versions of iOS (not only iOS6), and allows you to do almost every kind of caroussel, including iCarouselTypeCoverFlowand iCarouselTypeCoverFlow2types (see the README on its github)
  • 如果你的应用只有iOS6+,不需要支持iOS5,你可以使用UICollectionView来实现。您将需要构建一些自定义布局——在您使用 Apple ID 登录后,请参阅此处的 WWDC'12 会议 219。您还可以在网上找到大量教程,只需 google 搜索UICollectionView关键字即可。
  • 如果您需要支持 iOS5 或更早版本,或者如果您不想构建自己的自定义UICollectionViewLayout,您可以使用一些已经创建的类——网上有很多这样的类。最著名的一个是github上的iCaroussel,它是免费的,兼容多个版本的 iOS(不仅是 iOS6),并且允许您执行几乎所有类型的轮播,包括iCarouselTypeCoverFlowiCarouselTypeCoverFlow2类型(请参阅其 github 上的自述文件)

回答by Robotic Cat

A UICollectionView in iOS6 will allow you to do this. Look at the WWDC 2012 Videos (on developer.apple.com):

iOS6 中的 UICollectionView 将允许您执行此操作。查看 WWDC 2012 视频(在 developer.apple.com 上):

  • Session 205 - Introducing Collection Views
  • Session 219 - Advanced Collection Views and Building Custom Layouts
  • 第 205 节 - 介绍集合视图
  • 第 219 课 - 高级集合视图和构建自定义布局

To get the videos:

获取视频:

  • Login to developer.apple.com and click on "iOS Dev Center" (on the left)
  • Then under "Development Videos" (on the left) click on WWDC 2012
  • You may be prompted to sign-in again but after that you can just click on the video
  • All the WWDC 2012 videos are also available on iTunesU
  • 登录 developer.apple.com 并点击“iOS Dev Center”(左侧)
  • 然后在“开发视频”(左侧)下单击 WWDC 2012
  • 系统可能会提示您再次登录,但之后您只需点击视频即可
  • 所有 WWDC 2012 视频也可以在 iTunesU 上找到

The videos also show example code.

这些视频还显示了示例代码。

There is also example code on Github: Coverflow example

Github上也有示例代码: Coverflow example