iphone – 在iOS中使用Open Cover Flow用于视频幻灯片而不是图像

iphone – 在iOS中使用Open Cover Flow用于视频幻灯片而不是图像,第1张

概述您可以在iOS中使用多个视频而不是图像的封面流吗?用户将看到每个视频的开头仍然是播放按钮而不是图像,有点像Youtube. 因此,它不是像iOS中当前Cover Flow那样的一组图像,而是一组视频.或视频和图像混淆. iCarousel是我在这种情况下使用的框架.它是一个CoverFlow替换库,因为CoverFlow是iOS下的未记录的API.请参阅GitHub网站上的说明并阅读下面的说明. 您可以在iOS中使用多个视频而不是图像的封面流吗?用户将看到每个视频的开头仍然是播放按钮而不是图像,有点像Youtube.

因此,它不是像iOS中当前Cover Flow那样的一组图像,而是一组视频.或视频和图像混淆.

解决方法 iCarousel是我在这种情况下使用的框架.它是一个CoverFlow替换库,因为CoverFlow是iOS下的未记录的API.请参阅GitHub网站上的说明并阅读下面的说明.

@H_502_19@

Unlike many other “CoverFlow” librarIEs,iCarousel can work with any kind of vIEw,not just images,so it is IDeal for presenting paged data in a fluID and impressive way in your app.

我没有尝试使用视频对象,但是从文档中看,您可以传入视频对象或缩略图,点击后加载视频.在性能方面,缩略图会更有意义.以下是自述文件的源代码以及如何使用它的说明.

@H_502_19@

The iCarousel follows the Apple convention for data-driven vIEws by
provIDing two protocol interfaces,iCarouselDataSource and
iCarouselDelegate. The iCarouselDataSource protocol has the following
required methods (note: for Mac OS,substitute NSVIEw for UIVIEw in
method arguments):

- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel;

Return the number of items (vIEws) in the carousel.

- (UIVIEw *)carousel:(iCarousel *)carousel vIEwForItemAtIndex:(NSUInteger)index reusingVIEw:(UIVIEw *)vIEw;

Return a vIEw to be displayed at the specifIEd index in the carousel. The reusingVIEw argument works like a UIPickerVIEw,where vIEws that have prevIoUsly been displayed in the carousel are passed back to the method to be recycled. If this argument is nil,you can set its propertIEs and return it instead of creating a new vIEw instance,which will slightly improve performance. Unlike UItableVIEw,there is no reuseIDentifIEr for distinguishing between different carousel vIEw types,so if your carousel contains multiple different vIEw types then you should just ignore this parameter and return a new vIEw each time the method is called. You should ensure that each time the carousel:vIEwForPageAtIndex: method is called,it either returns the reusingVIEw or a brand new vIEw instance rather than maintaining your own pool of recyclable vIEws,as returning multiple copIEs of the same vIEw for different carousel item indexes may cause display issues with the carousel.

因此,对于第二种方法,您可以实现作为视频缩略图的UIImageVIEw,并且每次为每个视频重复使用视图.这样做的好处是你可以混合图像和视频,只有当你需要全屏显示图像/视频时才能区分.它就像查询类一样简单,然后设置一个基于类显示的不同视图.这是足够的信息吗?如果有什么不清楚,请告诉我.

总结

以上是内存溢出为你收集整理的iphone – 在iOS中使用Open Cover Flow用于视频幻灯片而不是图像全部内容,希望文章能够帮你解决iphone – 在iOS中使用Open Cover Flow用于视频幻灯片而不是图像所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1083291.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存