0
2 개의 UIViewController가있는 매우 간단한 앱이 있습니다. 하나는 기본보기이고, 두 번째는 옵션 페이지입니다. 하나에서 다른 하나에 애니메이션을 적용하면 회전이 완료 될 때까지 UISwitches 및 기타 컨트롤이 완전히 그려지지 않습니다. 애니메이션을 사용하지 않으면 문제가 없습니다. 모든 것이 올바르게 표시됩니다. 코드는 다음과 같습니다.애니메이션이 완료 될 때까지 UIView 컨트롤이 그리지 않습니다.
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
if (self.optionsViewController.view.superview == nil)
{
if (self.optionsViewController == nil)
{
self.optionsViewController = [[OptionsViewController alloc] initWithNibName:nil bundle:nil];
}
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
[self.view insertSubview:self.optionsViewController.view atIndex:127];
}
[UIView commitAnimations];
설정 캐시 : 대부분 답변이 아닙니다. UISwitch 컨트롤이 잘 작동했지만 UINavigationBar/단추가 이상한 슬라이딩을합니다. transitionFromView로 전환하는 것이 효과가있었습니다 ... 실제로 루트 UIViewController가없는 실제 문제를 제외하고는 주 UI에서 전환하려고합니다. . 이 시점에서 다른 뷰를 양육하는 것 이외의 용도로 사용되지 않는 루트 컨트롤러로 앱을 다시 실행하는 것이 더 좋을 것이라고 생각합니다. – bratboy