当我回顾 iOS5 中的这种方式时,将 tableView 与 pageControl 混合使用存在很多问题 - 可以做到,但实现有问题。我想知道是否仍然如此。
我在 SO 上看到很多关于 pageControl 内的 tableView 的问题,但我问的是相反的问题。具体来说:
是否可以将 UIPageControl 放在 UITableViewController 的 tableView header 中?
黄色轮廓是tableViewHeader,蓝色是可滚动的tableView:
最佳答案
您必须在表格标题中添加自定义 UIPageControl,而不是像我在标题 View 中添加标签那样添加到标题 View 。
-(void)viewDidLoad
{
// ...
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(XXX, YYY, XXX, YYY)];
//...
UIPageControl *page = [UIPageControl alloc]init];
//...
[headerView addSubview:page];
self.tableView.tableHeaderView = headerView;
// ...
}
关于ios - 我可以将 UIPageControl 放在 UITableViewController 的表头中吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28456591/