2014-09-26 7 views
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); 

답변

0

좋아요, 저는 이것이 AutoLayout 문제임을 깨달았습니다. 흥미롭게도이 문제는 iOS 6에서 시작되어 iOS 7로 전달되었습니다. iOS 8에 영향을 미치지는 않습니다! 수정

선택 : - 1) 추가 제약 또는 2) 사용 안 함

을 자동 레이아웃 y를 중심 X & 모두 내가 번호 1 말인가하고 있지만, 원하는 결과를 생산!

관련 문제