ios - 如何将 UITableView Wrapper 的大小调整为与 UITableView 相同的大小?

标签 ios objective-c uitableview uiview

我的问题是 TableView 顶部的空白:

enter image description here

首先我以为这是一个标题:

enter image description here

但没有修复,然后我甚至在代码中更改了这些:

enter image description here

最后我看到这是调试中的包装 View :

enter image description here

我不想像这样建议循环 subview ,即使它没有解决我的问题:

for (UIView *subview in tableView.subviews)
{
    if ([NSStringFromClass([subview class]) isEqualToString:@"UITableViewWrapperView"])
    {
        subview.frame = CGRectMake(0, 0, tableView.bounds.size.width, tableView.bounds.size.height);
    }
}

任何人都知道为什么会发生这种情况,因为我以前没有遇到过这样的问题!

最佳答案

我使用解决了这个问题

-(void)viewWillLayoutSubviews{
  [super viewWillLayoutSubviews];
  self.tableView.contentInset = UIEdgeInsetsZero;
  self.tableView.scrollIndicatorInsets = UIEdgeInsetsZero;
  }

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection: (NSInteger)section{
  return 0.01;
  } 

关于ios - 如何将 UITableView Wrapper 的大小调整为与 UITableView 相同的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36178971/

相关文章:

ios - XCode 6中 Storyboard 和xib的自动约束?

ios - 是否可以仅使用 NSURLSession 为 UITableViews 构建异步图像下载机制?如何?

swift - 使用 coredata 时,在搜索栏取消按钮后 tableview.reloaddata() 不起作用

ios - 在 Watchkit Target 中使用 Swift 创建数据类

javascript - 滚动错误仅出现在 iPad 上

ios - 如何修复致命异常 : NSInternalInconsistencyException

ios - 如何将选定的表格 View 单元格文本发送到 iOS 中的上一个 View Controller ,Objective C(向后传递数据)

ios - 正确调整iPhone图片库中的方形裁剪图像大小的正确方法

ios - JSON解析UITableViewController

objective-c - 对关键事件使用react