Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Navigation bar overlap the tableview content after adding the UIRefreshControl? #150

Open
starlight173 opened this issue Aug 12, 2016 · 3 comments

Comments

@starlight173
Copy link

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?

@siegrainwong
Copy link

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

@starlight173
Copy link
Author

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

@siegrainwong
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants