iOS-coverFlow效果简单实现

来源:互联网 发布:caffe python 数据层 编辑:程序博客网 时间:2024/05/21 10:00
首先你需要PageFlowView的头文件和实现文件。
下载地址在https://github.com/kejinlu/PagedFlowView


1 #import "PagedFlowView.h"

2 添加委托<PagedFlowViewDelegate,PagedFlowViewDataSource>

3 声明

NSArray *imageArray;//用于装需要展示的图片

@property (nonatomic, strong) IBOutlet PagedFlowView *mPageFlowView;//这是实现coverFlow的主类

4 在xib文件或者storyboard文件中,关联mPageFlowView

5 在viewdidload函数中,设置属性

    imageArray = [[NSArray alloc] initWithObjects:@"1.png",@"2.jpg",@"1.png",@"2.jpg",@"1.png",@"2.jpg",@"1.png",@"2.jpg",nil];

    

    _mPageFlowView.delegate = self;

    _mPageFlowView.dataSource = self;

    _mPageFlowView.minimumPageAlpha = 0.3;

    _mPageFlowView.minimumPageScale = 0.9;


6 然后就可以运行了。。


1 0