相关疑难解决方法(0)

iOS 9 UITableView分隔符插入(显着的左边距)

我有之间的分隔符的问题UITableViewCell以s UITableViewiOS 9.它们具有显着的左边距.我已经有了删除引入的间距的代码,iOS 8但它无法使用iOS 9.看起来他们添加了别的东西.我想它可能与layoutMarginsGuide有关,但我还没想到它.有没有人有类似的问题,并找到了解决方案?

uitableview uikit ios ios9 xcode7

49
推荐指数
7
解决办法
3万
查看次数

iOS 9 UITableView单元格的文本标签不是UITableView的全宽

自更新到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)

但是我的细胞在左右两侧画得很大.知道为什么吗?

在此输入图像描述

objective-c uitableview ios

14
推荐指数
1
解决办法
3533
查看次数

标签 统计

ios ×2

uitableview ×2

ios9 ×1

objective-c ×1

uikit ×1

xcode7 ×1