UICollectionViewController相关

本文详细介绍了UICollectionView的使用方法,包括取消选中状态、显示菜单及编辑操作等,并深入探讨了UICollectionViewLayout的相关配置,最后讲解了UICollectionViewCell的自定义背景及布局。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#UICollectionView

参考:http://blog.youkuaiyun.com/king2716/article/details/17485237

//取消所有选中状态 

clearsSelectionOnViewWillAppear

//是否显示菜单

- (BOOL)collectionView:(UICollectionView *)collectionView shouldShowMenuForItemAtIndexPath:(NSIndexPath *)indexPath;

  //菜单中哪些编辑操作可以显示

- (BOOL)collectionView:(UICollectionView *)collectionView canPerformAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender;

  //对于显示的编辑操作怎么执行

- (void)collectionView:(UICollectionView *)collectionView performAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender

//选中时候触发

- (void)selectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UICollectionViewScrollPosition)scrollPosition;


//取消选中时候触发仅在多选时候可用

- (void)deselectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated;

 

 


#UICollectionViewLayout相关

参考:http://blog.youkuaiyun.com/majiakun1/article/details/17204921


#UICollectionViewCell

//cell的背景,大小自动适应cell

backgroundView

//cell选中时候的背景

selectedBackgroundView

//自定义内容的容器

contentView




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值