Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant select items when height in vertical layout is high #19

Open
diegoescobar79 opened this issue Jan 21, 2015 · 3 comments
Open

cant select items when height in vertical layout is high #19

diegoescobar79 opened this issue Jan 21, 2015 · 3 comments

Comments

@diegoescobar79
Copy link

I am doing something like this: (i am repeating elements just for the sake of showing a lot of elements)
NSArray *titles = [NSArray arrayWithObjects:[@"YES" uppercaseString], [@"NO" uppercaseString],[@"YES" uppercaseString], [@"NO" uppercaseString],[@"YES" uppercaseString], [@"NO" uppercaseString],[@"YES" uppercaseString],[@"YES" uppercaseString], nil];

URBSegmentedControl *control = [[URBSegmentedControl alloc] initWithItems:titles];

control.frame = CGRectMake((self.view.frame.size.width/2)-100, 5, 200.0, [titles count]*80);

From element 0 to element 4 i can select without problems.. but 5,6 and 7 its unselectable.. but if i change size from 80 to 40 .. it all works..

I cant find the reason for this !

@u10int
Copy link
Owner

u10int commented Jan 22, 2015

@diegoescobar79 I was able to setup a control similar to that you're having an issues with using the same array of titles you provided and item selection worked without issues regardless of the control's height. Check and verify that your control's frame doesn't extend beyond the bounds of its superview which can prevent it from receiving the necessary touch events.

@diegoescobar79
Copy link
Author

Thanks for answering.
I have the control in a scrollview and realized that if the control goed beyond the view when i scroll to see it, seems that the scrollview steals the touches from it..
U know something about this issues?
Regards

Enviado desde mi iPhone

El 21/01/2015, a las 8:28 p.m., Nicholas Shipes [email protected] escribió:

@diegoescobar79 I was able to setup a control similar to that you're having an issues with using the same array of titles you provided and item selection worked without issues regardless of the control's height. Check and verify that your control's frame doesn't extend beyond the bounds of its superview which can prevent it from receiving the necessary touch events.


Reply to this email directly or view it on GitHub.

@u10int
Copy link
Owner

u10int commented Jan 22, 2015

Have you debugged your view hierarchy to determine if the control is extending beyond one of its superviews? Or is your view hierarchy just something like UIViewController.view -> UIScrollView -> URBSegmentedControl?

It still sounds like the control's frame extends beyond its superview's bounds as I'm not aware of any issues with a scroll view blocking touch events on its subviews. If you could provide more code from your view setup and implementation that may help me better figure out the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants