三十七 tableView cell之间间距的问题处理
2018-01-31 10:14
465 查看
在开发中遇到的cell之间的间距处理的问题,cell之间有时候UI设计师,会设计成每个cell之间有留白出现,这种留白的处理有几种方法
1, tableView的style 设置为 group形式的 在对应的代理方法中设置section的头部和顶部就好了;
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 10;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 0.5;
}
2,在自定义cell的时候布局加入留白不做详细介绍;
3,偏移,同时偏移还可以设置横向的,修改x和宽度就好了
- (void)setFrame:(CGRect)frame{
frame.origin.y += 15;
frame.size.height -=15
[super setFrame:frame];
}
1, tableView的style 设置为 group形式的 在对应的代理方法中设置section的头部和顶部就好了;
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 10;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 0.5;
}
2,在自定义cell的时候布局加入留白不做详细介绍;
3,偏移,同时偏移还可以设置横向的,修改x和宽度就好了
- (void)setFrame:(CGRect)frame{
frame.origin.y += 15;
frame.size.height -=15
[super setFrame:frame];
}
相关文章推荐
- iOS之如何处理TableView cell内容不一致以及cell复用重叠的问题
- iOS tableView与collectionView的样式切换以及间距问题处理
- 如何处理Tableview中cell的单选问题
- ios tableView多个cell处理键盘遮挡内容视图的问题
- 如何解决关于TableView里面cell随机显示的问题
- TableView的cell加载倒计时重用问题解决方案
- 关于tableView的cell距离下面间距38的出现原因以及解决
- 隐藏TableView中Cell与Cell之间的border
- 终于搞定UIScrollView上的几个tableview和collection view之间切换的问题了
- tableview跳转指定cell的某组某行的蛋疼问题
- iOS中关于动态Tableview中的cell数据传输的多线程问题解决之拙见
- tableview列表中的cell单元格有倒计时的情况处理
- tableview重用和cell常见问题
- 1016-06-首页20-封装工具条---UITableView控件距离顶部的间距问题----cell选中时的背景颜色设置
- 如何解决关于TableView里面cell随机显示的问题
- 解决自定义可左右滑动cell时和tableview的滑动手势冲突问题
- 关于静态cell实现tableView顶部与状态栏顶部平齐的问题
- 如何解决关于TableView里面cell随机显示的问题
- iOS 设置tableView 组与组之间的间距,
- TableView的footerView不随cell滚动而停留在tableView底部的问题,ios tableviewfooter