嘿,我試圖根據我得到的數據旋轉圖像。圖像確實旋轉,但沒有動畫。animatewithduration無法正常工作?
下面的代碼..
UIImage *arrowimage = [UIImage imageNamed:@"arrow"];
NSInteger degrees = [_item.current_value integerValue] ;
NSLog(@"ANIMATION!!");
_imageView.image = arrowimage;
_curvalLabel.text = @"";
[UIView animateWithDuration:5.0 animations:^{
_imageView.transform = CGAffineTransformMakeRotation(degrees * M_PI/180.0);
} completion:^(BOOL finished){
}];
你使用自動佈局還是自動調整掩碼?你完成時的 – bilobatum
是_finished == YES_? – nielsbot
@bilobatum自動佈局。如果我打印它nielsbot uhm完成是null? :x – Aelion