collectionView代理方法快速设置cell大小上下左右间隔
来源:互联网 发布:华而不实为所欲为知乎 编辑:程序博客网 时间:2024/06/09 15:45
#define JianGe 25
#define GeShu 4
#define ScreenWidth ([UIScreen mainScreen].bounds.size.width)
#define Screenheight ([UIScreen mainScreen].bounds.size.height)
//定义每个UICollectionView的大小
- ( CGSize )collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return CGSizeMake((ScreenWidth -JianGe*(GeShu+1)) /GeShu, (ScreenWidth -JianGe*(GeShu+1)) /GeShu );
}
//定义每个UICollectionView的边距
- ( UIEdgeInsets )collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger )section {
return UIEdgeInsetsMake (JianGe , JianGe ,JianGe , JianGe );
}
//设置水平间距 (同一行的cell的左右间距)
-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
returnJianGe;
}
//垂直间距 (同一列cell上下间距)
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
returnJianGe;
}
- collectionView代理方法快速设置cell大小上下左右间隔
- collectionView 自动调整cell大小
- storybord 中设置collectionView中cell的背景色无效
- 多种Cell的CollectionView
- collectionview cell 拖动
- iOS 在TableView的Cell之间设置空白间隔空间
- 关于如何设置UITableView的Cell有间隔
- iOS 设置cell的在tableView中的间隔距离
- collectionview 不显示 ,collection view 代理方法不走
- ios 设置cell的selectedBackgroundView的大小
- tableview上cell 加载collectionview
- collectionView reloadData 之后 cell消失
- iOS开发实战——CollectionView中cell的间距设置
- 关于collectionView和tableView的两种cell的出列方法的区别
- TableView 或者collectionView 获取点击的cell 和当前行数的方法
- Cocos2d-JS中CollectionView实现不同大小Cell同时显示的技巧(ListView中添加显示标签)
- TabLayout中的Tab间隔设置方法
- RecyclerView 上下左右四种间距的设置方法
- css动画停在结束状态
- NTC33 Newtown Win Samsung Galaxy S7
- ubuntu ssh传输文件——scp
- 【学习】Hadoop大数据平台架构与实践--基础篇下
- Android架构设计---MVP模式第(二)篇,如何减少类爆炸
- collectionView代理方法快速设置cell大小上下左右间隔
- 字母统计(acm练习)
- 面试被虐系列_设计模式篇_单例模式
- J题
- macOS
- finally 是执行try return之前还是之后之争
- Android架构设计---关于MVVM模式的探讨
- phpstorm安装破解及汉化
- Rdd没法调用toDF原因