tags:

views:

35

answers:

1

I cannot figure out what is obscuring my buttons. The first image shows the buttons that I want to click. They are clickable while the view is contracted like this, but when the view is expanded like in the second image, the buttons are no longer clickable. There seems to be another view obscuring the buttons. Any thoughts on what might be causing that? If not, any idea how I can figure out what view is getting the tap events when I tap in that area?

alt text alt text

Thanks.

+1  A: 

You can patch a UIView method to see which views are getting hit-tested:

@implementation UIView (Debug)

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
    BOOL pointInside =  CGRectContainsPoint(self.bounds, point);
    if (pointInside) NSLog(@"%@", self);
    return pointInside;
}

@end

That will give you the hierarchy of views that the touch is hitting, from the UIWindow down to the one that handles (or doesn't handle) the event.

Tom
Great idea. That helped me find the issue. Thanks.
Matt Long