0
나침반을 회전시키는 다음 코드가 있습니다. 이 코드는 iPhone 6 및 iPhone 5의 iOS 8에서 정상적으로 작동합니다.iOS CABasicAnimation animationWithKeyPath : @ "transform.rotation"wobble
그러나 iOS 7.1.2를 사용하는 iPhone 5S에서이 이미지를 회전하면 이미지가 Z 축에서 벗어나서 흔들 리거나 떠 다니는 것처럼 보입니다 . 나는,이
사람이 어떤 조언을 제공 할 수
아이폰 OS 8을 실행하는 둘, 아이폰 5 또는 6 발생하지 않습니다 말하는 것처럼?
float oldRad = -manager.heading.trueHeading * M_PI/180.0f;
float newRad = -newHeading.trueHeading * M_PI/180.0f;
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.rotation"];
theAnimation.fromValue = [NSNumber numberWithFloat:oldRad];
theAnimation.toValue=[NSNumber numberWithFloat:newRad];
theAnimation.duration = 0.5f;
[compassimage.layer addAnimation:theAnimation forKey:@"animateMyRotation"];
compassimage.transform = CGAffineTransformMakeRotation(newRad);