samvermette / SVPullToRefresh

Give pull-to-refresh & infinite scrolling to any UIScrollView with 1 line of code.
http://samvermette.com/314
MIT License
4.82k stars 1.09k forks source link

UITableView Top cell cut off my navigation bar #230

Open ghost opened 9 years ago

ghost commented 9 years ago

When I add this code to my viewDidLoad

// setup pull-to-refresh
[_packgeTableView addPullToRefreshWithActionHandler:^{
    NSLog(@"pull to refresh");
    [_packgeTableView.pullToRefreshView stopAnimating];

}];

And I add this code to my viewDidAppear [_packgeTableView triggerPullToRefresh];

My top cell of my table view is cut off, is there any known solution to this?

skmohanraj commented 9 years ago

Hi nporter19 , Do you got solution for this issue? if yes mean please help me to resolve this. Thanks in advance!

liruqi commented 9 years ago

You need to add action handler in - viewDidAppear method (or after), as you can get correct scroll view contentInset then. In - viewDidLoad, your scroll view has not set the final contentInset after in iOS7 or later, typically all zeros.

- addPullToRefreshWithActionHandler method record current scrollview contentInset as originalTopInset, originalBottomInset, and reset to that contentInset after - stopAnimating.

Sean-Wang commented 9 years ago

BUG: TableView section headers hide behind the Navigation bar in iOS 7 #181 @skmohanraj @nporter19

skyline75489 commented 9 years ago

@liruqi Thanks, man. It did the trick!