TLYShyNavBar icon indicating copy to clipboard operation
TLYShyNavBar copied to clipboard

Navigation bar overlap the tableview content after adding the UIRefreshControl?

Open starlight173 opened this issue 7 years ago • 3 comments

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?

starlight173 avatar Aug 12 '16 10:08 starlight173

#99 szweier's comment may helpful. if you have extensionView, try set that "-64" more smaller.

siegrainwong avatar Aug 18 '16 08:08 siegrainwong

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?!

starlight173 avatar Aug 22 '16 08:08 starlight173

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.

siegrainwong avatar Aug 23 '16 03:08 siegrainwong