我有之间的分隔符的问题UITableViewCell以s UITableView上iOS 9.它们具有显着的左边距.我已经有了删除引入的间距的代码,iOS 8但它无法使用iOS 9.看起来他们添加了别的东西.我想它可能与layoutMarginsGuide有关,但我还没想到它.有没有人有类似的问题,并找到了解决方案?
自更新到iOS 9以来,iPad横向中的表格视图单元格不再在单元测试中拉伸表格的整个宽度.
我的测试是一个简单的表,最后拍摄快照.
- (void)testTableSize{
UIViewController *viewController = [[UIViewController alloc] init];
UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0,0,viewController.view.bounds.size.width, viewController.view.bounds.size.height) style:UITableViewStylePlain];
tableView.dataSource = self;
tableView.delegate = self;
[tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
[viewController.view addSubview:tableView];
ASCSnapshotVerifyViewiPad([viewController view]);
}
Run Code Online (Sandbox Code Playgroud)
对于这个例子,单元格非常简单
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// Configure the cell...
cell.textLabel.backgroundColor = [UIColor blueColor]; // Demo purpose
cell.textLabel.backgroundColor = [UIColor yellowColor]; // Demo purpose
cell.textLabel.text = [NSString stringWithFormat:@"Cell %d", (int)indexPath.row];
return cell;
Run Code Online (Sandbox Code Playgroud)
但是我的细胞在左右两侧画得很大.知道为什么吗?