如何让我的标题粘贴到tableView?

时间:2014-04-13 08:52:04

标签: ios uitableview tableview

我用

创建标题
 - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 

并使用

设置高度
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 

我有一个标题和一个部分。

我在从UITableViewController继承的代码中创建VC 我使用UITableViewStyleGrouped

然后我向下滚动标题消失

1 个答案:

答案 0 :(得分:0)

您应该使用Plain tableViewStyle。见here

    self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];