ios - Allow UIScrollView to Scroll Past Content Without Bouncing -
ios - Allow UIScrollView to Scroll Past Content Without Bouncing -
overview
i'm building app allows user overscroll main uicollectionview
amount in order load related content. tactile experience of overscroll should same many other ios apps cause content on current page refresh, set collectionview.bounce = yes
.
once user overscrolls designated amount, want move current uicollectionview
downwards , out of view, while simultaneously moving new page downwards view top of device, similar inter-article navigation in digg iphone app.
i'm detecting overscroll using uiscrollviewdelegate
method:
-(void)scrollviewdidenddragging:(uiscrollview *)scrollview willdecelerate:(bool)decelerate { cgfloat offsety = scrollview.contentoffset.y; cgfloat contentheight = scrollview.contentsize.height; if (offsety < -40){ [self.delegate overscrolledup]; } if (offsety - (contentheight - scrollview.frame.size.height) > 40){ [self.delegate overscrolleddown]; } }
problem the delegate takes care of moving frames of these uicollectionview
s, problem current page moving downwards , out of view (or , out of view if user overscrolls down), uicollectionview
bouncing scroll contentoffset
of (0,0). results in unusual looking animation i'd avoid. want user able overscroll indicator shown describing new content can see, don't want overscroll reversed during page-changing animation.
is there way prevent uicollectionview
/uiscrollview
returning scroll (0,0) after user scrolls past content?
take at
https://github.com/enormego/egotableviewpullrefresh
it contains pull refresh tableview code, can utilize straight or source of inspiration.
ios uiscrollview uicollectionview overscroll
Comments
Post a Comment