首页 > 其他 > 详细

关于collectionView 的头视图

时间:2015-10-14 21:15:21      阅读:145      评论:0      收藏:0      [点我收藏+]

1. 头视图大小

 layout.headerReferenceSize = CGSizeMake(375, 200);

// 注册头视图

    [self.collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"headerReuse"];

    

 

// 设置表头和区域内容

-(UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath

{

    

 UICollectionReusableView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"headerReuse" forIndexPath:indexPath];

  

    headerView.backgroundColor = [UIColor cyanColor];

    headerView.userInteractionEnabled = YES;

 

  return headerView;

}

 

关于collectionView 的头视图

原文:http://www.cnblogs.com/fan-cong/p/4878419.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!