小编lev*_*han的帖子

UIView的.为什么在其父母的范围之外的子视图没有接触?

我有一个简单 - 琐碎的 - UIView父/子层次结构.一位家长(UIView).一个孩子(UIButton).父母边界小于孩子的边界,因此孩子的一部分延伸到其父母的边界框之外.

这就是问题:父母的bbox之外的孩子的那些部分没有接触到.只有在父级的bbox内点击才允许子按钮接收触摸.

有人可以建议修复/解决方法吗?

UPDATE

对于那些关注这个问题的人,这里是我实施的@Bastians最优秀答案的解决方案:

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {

    BOOL isInside = [super pointInside:point withEvent:event];

    // identify the button view subclass
    UIButton *b = (UIButton *)[self viewWithTag:3232];
    CGPoint inButtonSpace = [self convertPoint:point toView:b];

    BOOL isInsideButton = [b pointInside:inButtonSpace withEvent:nil];

    if (isInsideButton) {

        return isInsideButton;

    } // if (YES == isInsideButton)

    return isInside;        
}
Run Code Online (Sandbox Code Playgroud)

uiview hittest ios

36
推荐指数
2
解决办法
9465
查看次数

更改iPhone应用程序的系统字体 - 整个应用程序

有没有办法可以为整个应用程序更改系统字体?

我想为整个应用程序定义字体,这样我就不必去单个标签或单个字体来改变它.我想要一个通用的定义,它将改变应用程序中存在的所有字体.我该怎么做呢?

iphone fonts pixate

6
推荐指数
1
解决办法
4582
查看次数

标签 统计

fonts ×1

hittest ×1

ios ×1

iphone ×1

pixate ×1

uiview ×1