首页 > 为什么在iOS7模拟器中可以正常运行,在iOS8模拟器中无效。。。

为什么在iOS7模拟器中可以正常运行,在iOS8模拟器中无效。。。

Xcode6.2,OSX 10.10.3beta,为什么在iOS7.1模拟器中可以正常运行,在iOS8版本以上模拟器中无效。。。

    - (void)titleButtonClick:(XXTitleButton *)titleButton {
    UIImage *down = [UIImage imageWithName:@"navigationbar_arrow_down"];
    UIImage *up = [UIImage imageWithName:@"navigationbar_arrow_up"];
    if (titleButton.currentImage == down) {
        [titleButton setImage:up forState:UIControlStateNormal];
        [self.view addSubview:self.titleMenu];
    }else {
        [titleButton setImage:down forState:UIControlStateNormal];
        [self.titleMenu removeFromSuperview];
    }

}

if (titleButton.currentImage == down)

不能用这样的判断,建议为button的两种状态设置图片,比如:normal->up, selected->down,然后使用titleButton.selected来判断当前button的状态


你应该检查下XXTitleButton中是否存在不兼容的情况

【热门文章】
【热门文章】