下载此文档

IOS使用UICollectionView实现无限轮播效果.doc


文档分类:IT计算机 | 页数:约3页 举报非法文档有奖
1/3
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/3 下载此文档
文档列表 文档介绍
y的s
ction
o即可ontl
IOS使用UlCollectionVie实现无限轮播效果
―、案例演示本案例e演示的是一个首页轮播的案例,支持手动轮播和自动轮播。知识点主要集中在JICollectionVieWDSi的使用。ontal;
=0;
、初始化UlCollectionView对象
UICollectionView*collectionView=[[UICollectionViewalloc]initWithFrame:CGRectMake(0,,SCREEN_WIDTH,200)collectionViewLayout:flowLayout];=self;
=self;=NO;=YES;
=[UIColorclearColor];
[:collectionView];
、UICollectionView的UICollectionViewDataSourcef弋理方法
#pragmamark-UICollectionViewDataSource-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView*)collectionView{returnYYMaxSections;
}
-(NSInteger)collectionView:(UICollectionView*)collectionViewnumberOfItemsInSection:(NSInteger)section{
;
}
-(UICollectionViewCell*)collectionView:(UICollectionView*)collectionViewcellForItemAtIndexPath:(NSIndexPath*)indexPath{
YYCell*cell=[collectionViewdequeueReusableCellWithReuseIdentifier:YYIDCellforIndexPath:indexPath];
if(!cell){
cell=[[YYCellalloc]init];
}=[];
returncell;
}
、定时器的开启和关闭
#pragmamark添加定时器
-(void)addTimer{
NSTimer*timer=[NSTimerscheduledTimerWithTimeInterval:1target:selfselector:***@selector(nextpage)userInfo:nilrepeats:YES];
[[NSR

IOS使用UICollectionView实现无限轮播效果 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数3
  • 收藏数0 收藏
  • 顶次数0
  • 上传人小辰GG
  • 文件大小101 KB
  • 时间2022-05-26