objective c - UIScrollView that scrolls only programmatically -
we need make scroll view scrolling when user swipe @ area on screen, not inside scroll view .
so have created scroll view working great ,now struggling find way disable scrolling within scroller , somehow read user swiping in relevant area(some strip view), , send swipes scroller, scroll programmatically with:
[scrollview setcontentoffset:cgpointmake(x, y) animated:yes];
is right way achieve , or there out of box way ?
how disable scrolling option inside scroller ( without disabling touches inside him-because has tableview inside), , scroll programatically?
edit ::
i set the
[self.scrollview setpagingenabled:yes]; [self.scrollview setscrollenabled:no];
than no scrolling enabled. when swipe in view trying move scroller with:
**[self.scrollview scrollrecttovisible:cgrectmake(scrollxpo+10, y, width, height) animated:yes];**
but, moving 10 pixels , not moving anymore, paging not working in constellation ..
edit2
changed :
self.scrollview.contentoffset.x+40
works, no paging yet ..
how fix little things ?
you can set uiscrollview
's scrollenabled
no
disable scrolling touches, still keep possibility scroll in code. can use setcontentoffset:animated
scroll view relevant visible area according needs (swipine in relevant area).
as uiscrollview's documentation says:
a boolean value determines whether scrolling enabled. if value of property
yes
, scrolling enabled, , ifno
, scrolling disabled. defaultyes
. when scrolling disabled, scroll view not accept touch events; forwards them responder chain.
Comments
Post a Comment