使用纯代码实现UICollectionView(UITableView)需要注册

UICollectionView *_collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds];  

    _collectionView.dataSource = self;

    _collectionView.delegate = self; 

    [self.view addSubview:_collectionView];

//    使用纯代码 编写collectionView 需要注册cell类

    [_collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"CollectionViewCell"];

 

posted on 2015-03-21 16:10  独叹梅花瘦2015  阅读(243)  评论(0)    收藏  举报

导航