• iOS注册collcetionViewFlowLayout


      self.arr = [[NSMutableArray alloc] init];

      for (int i = 0; i < 9; i++) {

        [self.arr addObject:[UIImage imageNamed:[[NSString alloc] initWithFormat:@"%d",i + 1]]];

      }

      UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];

      [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];

      self.collectionView = [[UICollectionView alloc] initWithFrame:[[UIScreen mainScreen] bounds] collectionViewLayout:flowLayout];

      [self.collectionView registerClass:[CollectionViewCell class] forCellWithReuseIdentifier:@"MyCollectionCell"];

      

      self.collectionView.backgroundColor = [UIColor whiteColor];

      [self.view addSubview:self.collectionView];

     

      self.collectionView.dataSource = self;

      self.collectionView.delegate = self;

      [self.collectionView registerClass:[CollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"Header"];

     

     

     【微分享】:为明天做准备的最好方法就是集中你所有智慧,所有的热忱,把今天的工作做得尽善尽美,这就是你能应付未来的唯一方法!

  • 相关阅读:
    等级,
    JS高阶---回调函数
    JS高阶---函数
    JS高阶---对象
    JS高阶---数据、变量、内存
    JS高阶---简介+数据类型
    JS里==和===区别
    vue中assets和static的区别
    vue2.0 实现导航守卫(路由守卫)---登录验证
    exports与module.exports,export与export default 之间的关系和区别
  • 原文地址:https://www.cnblogs.com/supersr/p/5260527.html
Copyright © 2020-2023  润新知