开发者

UIView Obscuring Other Views

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 obsc开发者_JAVA百科uring 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 http://www.matthew-long.com/download/clickable.png alt text http://www.matthew-long.com/download/blank.png

Thanks.


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜