Change the click trigger of a Uisegmentedcontrol inside a Uiscrollview

Asked

Viewed 45 times

0

I need to change the drive of a UISegmentedControl, because I have a form, with several UISegmentedControl, contained in a UIScrollView and when I roll playing on top of a UISegmentedControl it selects one of the values.

Would you like it not to be selected. Is there any way to change this behavior? The UISegmentedControl can check if I am going down, up or pressing the screen so that the element is not selected?

1 answer

0


Well, theoretically he shouldn’t select if you’re performing a scrolling motion on his UIScrollView. Before anything else, make sure that the UISegmentedControl really is inside the UIScrollView and not underneath or above.

Another thing you can do to try to solve this problem, which will work depending on your overall scenario UIViewController, is set the property exclusiveTouch of UISegmentedControl for NO. This way the touch will also be passed on to the UIScrollView that will continue allowing the scrolling movement.

If none of this works for you, one solution that can be used is to disable the UISegmentedControl as long as the UIScrollView is being moved. To apply such a solution you need to sign the delegate of UIScrollView (UIScrollViewDelegate) and implement the desired methods (start and end of scrolling). Just set the property enabled of UIScrollView for YES and NO within each delegate callback.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.