2016-03-11 tableview cell 可以将横线铺满width
代理:
- (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];
}
}
2:viewdidload中
if ([self.MedicatableView respondsToSelector:@selector(setSeparatorInset:)]) {
[self.MedicatableView setSeparatorInset:UIEdgeInsetsZero];
}
if ([self.MedicatableView respondsToSelector:@selector(setLayoutMargins:)]) {
[self.MedicatableView setLayoutMargins:UIEdgeInsetsZero];
}
if([[[UIDevice currentDevice]systemVersion]floatValue]>=7.0)
{
self.edgesForExtendedLayout = UIRectEdgeNone;
self.automaticallyAdjustsScrollViewInsets = NO;
}