Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图让我的第一行UITableView显示在表格tableHeaderView属性的顶部,并带有一些偏移量。
UITableView
tableHeaderView
知道如何使用表格视图执行此操作吗?
我设法以一种非常简单的方式做我想做的事:
[self.tableView sendSubviewToBack:self.tableView.tableHeaderView];
正如@Eiko 所指出的,我试图用我的其他答案做的事情可能不安全,并且可能导致不可预见的情况。
我最终做的是创建一个新的单独UIView并将其定位在适当的位置作为子视图,UITableView以模仿 tableView 的 tableViewHeader 属性的行为。
UIView