首页 > 其他 > 详细

代码简化

时间:2015-09-08 00:01:07      阅读:391      评论:0      收藏:0      [点我收藏+]

简化ViewController代码量

 

ESSeparatorInset https://github.com/EnjoySR/ESSeparatorInset

一行代码移除 UITableView 分割线左边的默认的间距

用法:

#import "UIViewController+ESSeparatorInset.h"
//分割线顶格
[self setSeparatorInsetZeroWithTableView:self.tableView];

//或 自定义间距
[self setSeparatorInsetWithTableView:self.tableView inset:UIEdgeInsetsMake(0, 8, 0, 8)];

 

tableView 空白视图

UIView *emptyView = [[UIView alloc] initWithFrame:self.tableView.frame];

self.tableView.tableHeaderView = emptyView;
self.tableView.userInteractionEnabled = NO;

//When you have data you just remove the header and reenable user interaction:
self.tableView.tableHeaderView = nil;
self.tableView.userInteractionEnabled = YES;

  

 

 

代码简化

原文:http://www.cnblogs.com/sixindev/p/4790143.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!