我在 UITableViewController 中创建了一个简单的表格视图标题:
UIView *tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.bounds.size.width, [[UIScreen mainScreen] bounds].size.height * 5 / 8)];
[tableHeaderView setBackgroundColor:[UIColor flatNavyBlueColorDark]];
[self.tableView setTableHeaderView:tableHeaderView];
现在我想创建一个捕捉/弹性行为,以便当用户滚动表头时,当 50% 的表头超出主屏幕的框架时,其余部分会自动捕捉,以便整个表头滚动出来。如这些图像所述:
此时,标题会自动关闭。
帮助?