UICollectionViewHeader和Footer-创新互联

@interface FooterView : UICollectionReusableView

成都创新互联公司从2013年成立,是专业互联网技术服务公司,拥有项目成都做网站、网站建设、外贸营销网站建设网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元广东做网站,已为上家服务,为广东各地企业和个人服务,联系电话:18980820575

Footer 和 Header 基于 UICollectionReusableView

重用标识

static NSString * headeridentifier = @"header";
static NSString * footeridentifier = @"FOOTER";

 注册重用标识符

    第一个参数 : 返回的view类型
    第二个参数: 设置view的种类 (header , footer)
    第三个参数: 设置重用标识符

   [cView registerClass:[HeaderView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:headeridentifier];

    [cView registerClass:[FooterView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:footeridentifier];

Header 和 Footer 重用

- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
 if ([kind isEqualToString:UICollectionElementKindSectionHeader]) {

   HeaderView * headerView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:headeridentifier forIndexPath:indexPath];
   headerView.backgroundColor = [UIColor whiteColor];
   headerView.label.text = @"header";
   headerView.label.textAlignment = NSTextAlignmentCenter;

    return headerView;
 }

   FooterView * footerView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:footeridentifier forIndexPath:indexPath];
   footerView.backgroundColor = [UIColor whiteColor];
   footerView.label.text = @"footer";
   footerView.label.textAlignment = NSTextAlignmentCenter;

   return footerView;

}

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网站名称:UICollectionViewHeader和Footer-创新互联
网页地址:http://lszwz.com/article/hepso.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款