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

Pull to Refresh not working on UIScrollView with Auto Layout #219

Open Kennouf opened 10 years ago

Kennouf commented 10 years ago

Hey,

Sorry if my question seems stupid but I've been trying everything to get it to work for several days now and nothing comes to my mind anymore.

I'm trying to use the Pull to Refresh on a UIScrollView which is, in my storyboard, fixed to the main view of my View Controller (space constraints to superview 0,0,0,0).

Code is pretty straightforward :

__weak ALExploreViewController *weakSelf = self; [self.globalScrollView addPullToRefreshWithActionHandler:^{ [weakSelf refreshData]; }]; [self.globalScrollView triggerPullToRefresh];

The thing is, when I launch the app, the pull to refresh appears as I manually triggered it. Then I make it disappear when my data are updated (self.globalScrollView.showsPullToRefresh = NO;). And then when I scroll up to refresh, the "pull to refresh" view won't show. If I deactivate bouncing, the view won't event scroll upper than y=0, and if I activate it, it bounces but no sign of the P2R view.

Any ideas ? Please ?