所以我有一个 UITableView
。它的数据源是搜索后加载的自定义对象的 NSArray
。当我滚动到底部时,一切正常,scrollIndicator
根据需要滚动到底部。
现在,当我滚动回到顶部时,scrollIndicator 在我的 UINavigationbar 下方约 50 像素处停止。
我不知道为什么这种行为只发生在这个 tableViewController
中,因为我的 UITabBarController
由 5 个 UITableViewcontrollers
组成,每个继承自同一个 super类(class)。
感谢任何帮助,提前致谢:)
编辑:
将以下代码放入viewWillAppear:
self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 0, 0);
解决了这个问题。虽然我仍然不知道为什么这个问题只发生在五个 tableViewControllers 之一......
最佳答案
看起来您可能已经设置了 scrollIndicatorInsets
ScrollView 的属性错误。底部和顶部可能相同。设置它,以便您只有底部的边距。
即
使用 UIEdgeInsetMake( <top> , <left>,<bottom>,<right>);
为了这。即对于你的情况
yourScrollView.scrollIndicatorInsets = UIEdgeInsetMake(0, 0,bottomInset,0); //Here bottom inset would be the value you have right now .
关于iphone - UITableView scrollIndicator 位置不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15429854/