레이블 (instructionLabel)을 확장하고 이동 한 다음 원래 크기로 되 돌렸지 만 새로운 위치에 둡니다.아핀 변환은 CGPoint 재배치를 방지합니다.
[UIView animateWithDuration:0.5
animations:^{
CGAffineTransform scale = CGAffineTransformMakeScale(2.0, 2.0);
CGAffineTransform translate = CGAffineTransformMakeTranslation(0.0, -70.0); // up 70
self.instructionsLabel.transform = CGAffineTransformConcat(scale,translate);
}
completion:^(BOOL finished) {
[UIView animateWithDuration:0.25
animations:^{
CGAffineTransform scale = CGAffineTransformMakeScale(1.0,1.0);
CGAffineTransform translate = CGAffineTransformMakeTranslation(0,-70.0); //left in place up 70
self.instructionsLabel.transform = CGAffineTransformConcat(scale, translate);
}
completion:^(BOOL finished) {}
];
나중에, 나는 명시 적으로 원래의 자리에 다시 라벨을 넣어 CGPointMake를 사용하지만, 그것은 (원래 위치에서 70 점까지) 번역 위치에 남아 있습니다.
instructionsLabel.frame = CGRectMake(384, 601, 655, 40);
//Adding this doesn't make any difference, in or out.
instructionsLabel.center=CGPointMake(384, 601);
나는 CGPointMake와 CGRectMake 문에 도달하는 것이 휴식과 NSLog에 의해 확인이 ... 그들은 단지 그 아핀 변환 한 후 작동하지 않습니다. 아무도 이유를 아나요? (번역 루틴 바로 뒤에 레이블을 다시 이동하고 싶지는 않지만 CGPointMake 루틴이 왜 그런 일을하지 않는지 알 수없는 경우).
주셔서 감사합니다. -Rob