Xcode6.2,OSX 10.10.3beta,為什么在iOS7.1模擬器中可以正常運(yùn)行,在iOS8版本以上模擬器中無(wú)效。。。
- (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];
}
}
人生最曼妙的風(fēng)景,竟是內(nèi)心的淡定與從容!
if (titleButton.currentImage == down)
You cannot use this judgment. It is recommended to set pictures for the two states of the button, such as: normal->up, selected->down, and then use titleButton.selected to determine the current button state