IOS UICollectionView使用
来源:互联网 发布:淘宝装修教程 编辑:程序博客网 时间:2024/06/06 00:34
@interface ProductShowViewController : BaseViewController<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,MJRefreshBaseViewDelegate>@property(nonatomic,retain) IBOutlet UICollectionView *CV_Prouct_list;//上拉加载@property(nonatomic, strong)MJRefreshFooterView *Footer;@end
#pragma mark -- UICollectionViewDataSource/** * 设置UICollectionViewCell显示的内容 */-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"ProductShowCollectionCell"; UINib *nib = [UINib nibWithNibName:@"ProductShowCollectionViewCell" bundle:[NSBundle mainBundle]]; [collectionView registerNib:nib forCellWithReuseIdentifier:CellIdentifier]; ProductShowCollectionViewCell *cell = (ProductShowCollectionViewCell*)[collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath]; cell.IV_image.image = [UIImage imageNamed:@"guide-1.jpg"]; cell.LB_name.text = @"某某某有限公司"; cell.layer.borderWidth = 1; cell.layer.borderColor = [[UIColor whiteColor] CGColor]; return cell;}/** * 设置UICollectionView项的个数 */-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ return 24;}/** * 设置展现section的个数 **/-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{ return 1;}#pragma mark -- UICollectionViewDelegateFlowLayout/** * 设置UICollectionViewCell的大小 */-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ double width = (self.view.bounds.size.width - 200) / 4; return CGSizeMake(width, width);}/** * 设置UICollectionViewCell四边距 **/-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{ return UIEdgeInsetsMake(30, 40, 10, 40);}/** * UICollectionView两列之间最小的间距 */-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section{ return 0.0f;}/** * UICollectionView两行之间最小的间距 */- (CGFloat) collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{ return 30.0f;}//----------------------------------------------------------------------------------UICollectionViewDataSource end
0 0
- ios UICollectionView的使用
- UICollectionView使用 - iOS开发
- ios UICollectionView的使用
- iOS UICollectionView简单使用
- iOS UICollectionView简单使用
- [IOS]UICollectionView的使用
- IOS SWIFT---使用UICollectionView
- ios UICollectionView的使用
- iOS UICollectionView 的使用
- iOS 之UICollectionView 使用
- iOS UICollectionView简单使用
- ios UICollectionView 的使用
- iOS UICollectionView简单使用
- iOS UICollectionView简单使用
- iOS---UICollectionView简单使用
- iOS ---UICollectionView简单使用
- iOS UICollectionView 使用详解
- iOS UICollectionView简单使用
- unity 杂记
- 用SurfaceView实现级联分层图(粗略篇)
- Python 字符串操作(string替换、删除、截取、复制、连接、比较、查找、包含、大小写转换、分割等)
- 【新手建站三部曲之一】——一块钱搭建自己的服务器(LAMP)
- 数据结构之大小堆&&优先级队列
- IOS UICollectionView使用
- 二叉树的递归遍历
- Android 通过ViewPager实现点击和滑动切换Fragment标签页
- 开发者的Facebook | GitHub投资人寻求退出?Microsoft意图收购?
- Git部分命令介绍
- AndroidNDK使用简介
- C/C++ 编译器的命名粉碎规则(name mangling)和C/C++混合(ZZ)
- Android应用中如何调用系统设置项
- MySQL锁表解决方法(转)