objective c - Disabling scrolling when image is zoomed -
i have image inside uiscrollview. want happen if zoomed in particular position, want disable scrolling (both vertical , horizontal) remain on zoomed area. can give me ideas on how this?
two things keep in mind:
- make sure want when need disable scroll. (you can use methods
uiscrollviewdelegate
accomplish that). - make
contentsize
ofuiscrollview
same size of frame. way both horizontal , vertical scroll disable.
cgrect myscrollviewrect = myscrollview.frame; cgsize myscrollviewframesize = cgsizemake(myscrollviewrect.frame.size.width, myscrollviewrect.frame.size.height); myscrollview.contentsize = myscrollviewframesize;
for clarity putted more code need to.
Comments
Post a Comment