Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView scrollIndicator position incorrect

So I have a UITableView. Its dataSource is an NSArray of custom objects beeing loaded after a search. When I scroll to bottom, everything works fine, the scrollIndicator scrolls to bottom as desired.

Now when I scroll back to top the scrollIndicator stops about 50pixel below my UINavigationbar.

I have no idea why this behaviour occurs only in this tableViewController, since my UITabBarController consists of 5 UITableViewcontrollers each inheriting from the same super class. Any help is appreciated, thanks in advance :)

EDIT:

Putting the following code in viewWillAppear:

self.tableView.scrollIndicatorInsets   = UIEdgeInsetsMake(0, 0, 0, 0); 

Solved the issue. Although I still don't know why this issue only occurs in one of the five tableViewControllers...

like image 505
pmk Avatar asked Mar 15 '13 10:03

pmk


1 Answers

It looks like you might have set the scrollIndicatorInsets property of the scroll view wrongly. It might be the same for both bottom and top. Set it so that that you only have the margin for bottom.

i.e use UIEdgeInsetMake( <top> , <left>,<bottom>,<right>); for this. i.e for your case

yourScrollView.scrollIndicatorInsets   = UIEdgeInsetMake(0, 0,bottomInset,0); //Here bottom inset would be the value you have right now .
like image 180
Rakesh Avatar answered Oct 20 '22 08:10

Rakesh