UICollectionViewCell的设置间距
2016-08-05 15:54
387 查看
UICollectionViewCell的设置间距
#pragma mark - UICollectionView 大小(宽高,平均一行三个)- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
CGFloat width = ([UIScreen mainScreen].bounds.size.width ) / 3;
return CGSizeMake(width, width);
}
// 设置间距,不设置默认间距比较大,导致一行放不了三个cell
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
return 0;
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section{
return 0;
}
相关文章推荐
- 一款应用的UI设计是否合格,该如何判断?
- ios-UI高级多线程 GCD实现单例模式
- easyui-combobox 绑定数据的俩中方式
- WPF async异步处理中实现 UI thread 的绑定同步
- request.setAttribute()与request.getSession().setAttribute()
- hdu 5793 A Boring Question(2016第六场多校)
- flask request用法
- LinkedBlockingQueue学习
- Spacebuilder在Mono上运行修改备忘
- HDU 5793 A Boring Question
- iOS UI调试神器,插件injection for Xcode使用方法
- HDU-5793-A Boring Question-打表找规律加模逆元
- UIImageView 的contentMode属性
- Android Handler中的handleMessage方法和post方法之源码剖析 及UI更新方法
- iOS UIAcceleration
- request和response
- iOS UITableView 的beginUpdates和endUpdates
- Android 错误之finished with non-zero exit value 2
- UITabBarController和UINavigationController搭配使用
- build.gradle配置versionCode、versionName、apk的名字