zoukankan      html  css  js  c++  java
  • 第十三篇、OC_UICollectionView的基本配置

    - (UICollectionView *) categoryCollectionView
    {
        if (! _categoryCollectionView) {
            
            // 创建布局
            UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init];
            layout.itemSize = CGSizeMake(KItemWidth,KItemHeight);
            layout.minimumInteritemSpacing = KSpace;
            layout.minimumLineSpacing = KSpace;
            layout.headerReferenceSize = CGSizeMake(KScreentW,KProductHeaderCellH);
            
            _categoryCollectionView = [[UICollectionView alloc]initWithFrame:self.view.bounds collectionViewLayout:layout];
            _categoryCollectionView.dataSource = self;
            _categoryCollectionView.delegate = self;
            _categoryCollectionView.backgroundColor = [UIColor colorWithRed:234.0/255 green:234.0/255 blue:234.0/255 alpha:1];
            
            // 注册
            [_categoryCollectionView registerNib:[UINib nibWithNibName:@"GFBCategoryCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:KProductCell];
            [_categoryCollectionView registerNib:[UINib nibWithNibName:@"GFBCategoryCollectionReusableView" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:KProductHeaderCell];
            
            // 设置内边距,添加轮播图
            _categoryCollectionView.contentInset = UIEdgeInsetsMake(KBanerH, 0, 0, 0);
    
        }
        return _categoryCollectionView;
    }
  • 相关阅读:
    jsp JavaBean配置
    jsp response对象
    tomcat 多servlet配置
    jsp session
    什么才是永恒?
    Class Diagram Of elvish ray 0.6 For Reference
    Dataflow
    过生日
    我们开始设计软件架构
    寻回旧作——Mars Princess
  • 原文地址:https://www.cnblogs.com/HJQ2016/p/6102538.html
Copyright © 2011-2022 走看看