如何创建保留在ipad上的多列表头

时间:2012-08-24 09:02:03

标签: ios uitableview storyboard

我使用故事板从UITableView创建了一个类,但是我想根据附件图像自定义tableview。任何想法我怎样才能实现它?

感谢您的帮助。 enter image description here

1 个答案:

答案 0 :(得分:1)

您也可以将UILabel添加到UIView,然后只需将UIView添加为UITableView的子视图。在CGRectMake();

期间添加UIView时,只需传入负Y坐标

然后你应该设置,表头将使用UITableView滚动。

// for table header that scrolls with the table
[myTableView addSubview:tableHeaderView];

如果您不希望表头与表一起滚动,那么您可以将UIView添加为视图控制器视图的子视图,即与UITableView处于同一级别,而不是将UIView添加到UITableView中。 :

// for non scrolling table header
[self.view addSubview:myTableView];
[self.view addSubview:tableHeaderView];