uitableview - Cancel UIRefreshControl when dragged up -
when refreshing taking place, (actionwheel spinning after pull down), want able cancel refreshing - facebook app.
pull down refresh , while not done yet, if pull spinner outside view, stop/cancel refresh.
i've tried check scrollviewdidscroll check against first visible row, action isn't smooth.
any better idea on how implement this?
thanks in advance!
actually, figured out. hope helps :)
when starting refresh, set kind of flag (here 'refreshing'), , check 1. refreshing state 2. detect whether contentoffset zeroed out.
- (void)scrollviewdidscroll:(uiscrollview *)scrollview{ //nslog(@"%f",[self.tableview contentoffset].y); if(refreshing){ if([self.tableview contentoffset].y >= 0){ refreshing = no; [self.refreshcontrol endrefreshing]; } } }
Comments
Post a Comment