在viewDidLoad里加上这两个判断
/**! 此判断主要针对tableView的分割线设置UIEdgeInsetsMake在ios8上无效 **/
if ([self.editorShippingAddressView.talbeView respondsToSelector:@selector(setSeparatorInset:)]) {
[self.editorShippingAddressView.talbeView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];
}
if ([self.editorShippingAddressView.talbeView respondsToSelector:@selector(setLayoutMargins:)]) {
[self.editorShippingAddressView.talbeView setLayoutMargins:UIEdgeInsetsMake(0,0,0,0)];
}
然后把下面的代理写一下
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
}
网友评论