iphone - UITableView scrollIndicator 位置不正确

标签 iphone objective-c uitableview scroll

所以我有一个 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/

相关文章:

ios - 我可以从 iOS 使用 Sql Server 数据库吗?

objective-c - "Weighted"随机数发生器

ios - UITableview:如何禁用某些行而不是其他行的选择

ios - 如何在 Swift 中将数据从一个 TableView 传递到另一个 TableView ?

iphone - ReloadTable 使应用程序崩溃

iphone - 是否可以通过SDK获取用户的apple ID?

iphone - 如何检查字符串是否仅包含 objective-c 中的字母数字字符?

iphone - iOS 中的 Facebook 发布错误

objective-c - [UICollectionViewCell imageView] : unrecognized selector sent to instance

ios - UiView 固定在 UiTableViewController 之上