TLYShyNavBar
TLYShyNavBar copied to clipboard
Navigation bar overlap the tableview content after adding the UIRefreshControl?
Hi I'm getting the issue that when I scroll up, the navigation bar is moved up, the tableview is sticked under the status bar. The I scroll down, the tableview is still with the status bar, the navigation bar overlap a part of the uitableview. I disabled adjust scroll view inset and set 'hasCustomRefreshControl = YES'. The navigation controller is inside a tabbar. Anyone know how to fix this?
#99 szweier's comment may helpful. if you have extensionView, try set that "-64" more smaller.
Fix that by making the refresh control as an extension view:
[self.shyNavBarManager setExtensionView:refreshControl];
That's weird. It supposed to be
self.shyNavBarManager.hasCustomRefreshControl = YES;
I still dont know why?!
Fix that by making the refresh control as an extension view: [self.shyNavBarManager setExtensionView:refreshControl];
I didn't see that and I didn't do it.
I have a custom refreshcontrol and an extensionView.
here is my part of code in TLYShyScrollViewController.m
- (CGFloat)updateLayoutIfNeeded
{
CGFloat magicFloat = self.hasCustomRefreshControl ? -217 : 0;
if ((self.scrollView.contentSize.height < FLT_EPSILON &&
([self.scrollView isKindOfClass:[UITableView class]] || [self.scrollView isKindOfClass:[UICollectionView class]])) ||
(self.scrollView.contentOffset.y <= magicFloat)) {
return 0.f;
}
//...
}
That magicFloat
solved my problem, and the "-217" is get from my scrollview's initial contentOffset.Y
, you can try this if you need.