开发者

Drawing view inside UIScrollView

I have a view with which you can do finger drawing. It's currently in UIScrollView. Although it can dr开发者_开发问答aw, it is very buggy because while I am drawing, the ScrollView scrolls up and down, so how can I make the scroll view stop scrolling if the touch is inside that view? Thanks.

Here's why I need scroll view, it bunch of contents and at the end, users sign in the customview.


You can put a custom button in your customview inside the UIScrollview. If the button is pressed set to OFF the scrollingEnabled property of the UIScrollView. Remember to set it to ON when the user releases the button.


If you don't want to use the scrollView for scrolling, why are you using it?

It sounds like you should remove it and subclass UIView. Can you give some more info on what you're trying to do with UIScrollView?


OK, I understand. You could turn OFF the scrollingEnabled property when there's a touch in the signature box and turn it back on when the person is done signing.

I think that would be the most natural thing way to do this.


I've worked with scroll views more often then I would have liked. Trust me, from experience, trying to control its scrolling and interception of gestures is just asking for trouble. When the user goes to sign inside of the scrollview, move the custom signature view from within the scrollview to a custom (and perhaps full screen) dialog with a Cancel/Done button.

Your users will thank you for a large and easier signature space, and the solution should work much better into the future and will not depend on the scroll view to allow you to track touches within it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜