iOS 8 UITableView分割线显示不完全解决方法如下:
1、创建UITableView后:
[C#] 纯文本查看 复制代码 // for ios 7
if ([houseTable respondsToSelector:@selector(setSeparatorInset:)]) {
[houseTable setSeparatorInset:UIEdgeInsetsZero];
}
// for ios8
if ([houseTable respondsToSelector:@selector(setLayoutMargins:)]) {
[houseTable setLayoutMargins:UIEdgeInsetsZero];
}
2、添加如下方法:
[C#] 纯文本查看 复制代码 -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPat{
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setSeparatorInset:)]){
[cell setSeparatorInset:UIEdgeInsetsZero];
}
}
分割线显示完全。
|