UITableView在顶部有一个差距

tra*_*uan 15 objective-c uitableview ios ios7 xcode5

我不确定现在问这个问题是否合适.我在表视图上使用Xcode 5(预览版).现在的问题是,如果我的表视图被选中,那么group我在第一个单元格和表格的上边缘之间存在间隙.

适用于uitable视图委托的代码如下

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 8;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *simpleTableIdentifier = @"SimpleTableItem";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];

    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
    }

    cell.textLabel.text = [NSString stringWithFormat:@"cell %d",indexPath.row];
    return cell;
}
Run Code Online (Sandbox Code Playgroud)

当我选择groupxib 时,下面的图片

在此输入图像描述

但是,如果我切换到plain,表是正常的

在此输入图像描述

对这种情况有任何想法.我用Google搜索,但似乎没有任何东西.欢迎任何帮助.

Jak*_*cer 19

这是iOS 7中分组表视图的预期外观.如果打开"设置"应用程序,您将在表格顶部和表格视图中的每个部分之间看到类似的分隔栏(灰色).

  • 呃:(为什么,为什么他们必须打破它:(我的用户名/密码登录thingy使用分组的UITableView现在在我的所有应用程序中被打破:( (3认同)
  • 嗯,分组UITableView的变化是iOS7中其他变化中最丑的...... (3认同)