为什么在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];
    }

}
阅读 3.7k
2 个回答
if (titleButton.currentImage == down)

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

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

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题