我有一个以非常标准的方式添加为UITableView标头的笔尖,如下所示:
self.headerView = [[[NSBundle mainBundle] loadNibNamed:@"NameHeaderView" owner:nil options:nil] firstObject];
[self.tableView setTableHeaderView:self.headerView];
但是当桌面视图滚动时,滚动条位于标题视图下方,之前是否有人看过这个?
答案 0 :(得分:0)
尝试设置
self.tableView.scrollIndicatorInsets = UIEdgeInset(self.headerview.height,0,0,0);
答案 1 :(得分:0)
尝试以下解决方案......
-(void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
self.tableView.contentInset = UIEdgeInsetsMake(self.headerview.height, 0, 0, 0);
self.automaticallyAdjustsScrollViewInsets=NO;
}
// OR
self.automaticallyAdjustsScrollViewInsets=YES;//it is YES by default
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeNone;
希望它可以帮助你......!