ios - Scroll view limit one border -


the property bounces can limit scroll view border, want limit 1 border, example: can drag on top border, bottom can't. have make using 2 views, want find direct way.

check scrollview's content offset if beyond bottom bounds using scrollviewdidscroll delegate method of uiscrollview , put bounce scrollview check bounce top bounds.

- (void)scrollviewdidscroll:(uiscrollview *)scrollview {         if (scrollview.contentoffset.y >= scrollview.contentsize.height - scrollview.frame.size.height) {             [scrollview setcontentoffset:cgpointmake(scrollview.contentoffset.x, scrollview.contentsize.height - scrollview.frame.size.height)];         }     } 

note : set scrollview delegate self scrollview instance call delegate method while scrolling . cheers :)

yourscrollviewinstance.delegate = self 

Comments