1.<UITableView+FDTemplateLayoutCell.h>在iOS10上使用时会崩溃,崩溃时提示to uncaught exception ‘NSInternalInconsistencyException’, reason: 'Cell must be registered to table view for identifier - CircleCommentTableViewCell’
原因:
_tableView.tableFooterView = [[UIView alloc] init];
这句话写在注册cell之前,程序会crash,是因为你在设置表视图的tableFooterView的时候,他就会走tableView的数据源和代理方法,而这个时候你还没有注册cell,导致他认为你还没有注册cell,导致崩溃.所以只要把_tableView.tableFooterView = [[UIView alloc] init];放在注册之后即可哦,我给大家提个例子`- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight-Base_NavbarHeight-Base_TabbarHeight) style:UITableViewStylePlain];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[_tableView registerNib:[UINib nibWithNibName:@"CircleTableViewCell" bundle:nil] forCellReuseIdentifier:@"CircleTableViewCell"];
[_tableView registerNib:[UINib nibWithNibName:@"JTCommentAllTableViewCell" bundle:nil] forCellReuseIdentifier:@"JTCommentAllTableViewCell"];
[_tableView registerNib:[UINib nibWithNibName:@"CircleCommentTableViewCell" bundle:nil] forCellReuseIdentifier:@"CircleCommentTableViewCell"];
_tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
}
return _tableView; }
2.mjrefresh无法下拉刷新
原因:_tableView.bounces = NO;
需要将此处设置为yes,正确的可以直接不设置,系统默认设置的就是yes
3.mjrefresh偏移在顶部20或tableview偏移20,下面贴上处理方法`- (void)setupiOS11TopOffset:(UITableView *)tableView {
if (@available(iOS 11.0, *)) {
tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}else {
self.automaticallyAdjustsScrollViewInsets = NO;
}
}