[英]UIView Animation
I need to flip my view horizontally. 我需要水平翻转视图。
I tried to flip along with the navigation Controller when i did this my background screen becomes black 当我这样做时,我尝试与导航控制器一起翻转,背景屏幕变黑
How to avoid this? 如何避免这种情况?
I tried this code.. 我尝试了这段代码。
HomeViewController *homeVC = [[HomeViewController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:homeVC];
nav.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
nav.modalPresentationStyle = UIModalPresentationFormSheet;
[[self navigationController] presentViewController:nav animated:YES completion:^{
[Constants showHomeScreenOnViewController:self];
}];
Please try the below code :- 请尝试以下代码:-
UIViewController *controller = [[[MyViewController alloc] init] autorelease];
UIViewAnimationTransition trans = UIViewAnimationTransitionCurlUp;
[UIView beginAnimations: nil context: nil];
[UIView setAnimationTransition: trans forView: [self window] cache: YES];
[navController presentModalViewController: controller animated: NO];
[UIView commitAnimations];
You can avoid that black screen by changing your presentation style with below code, 您可以通过以下代码更改演示样式来避免黑屏,
Use this, 用这个,
nav.modalPresentationStyle = UIModalPresentationOverFullScreen;
OR 要么
nav.modalPresentationStyle = UIModalPresentationOverCurrentContext;
Hope this will help you. 希望这会帮助你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.