简体   繁体   English

UIImagePickerController之后的怪异动画

[英]weird animation after UIImagePickerController

My rootViewController is based on UITabViewController and one of the tab view, that i initialize a UINavigationController to push a view. 我的rootViewController基于UITabViewController和选项卡视图之一,我初始化了一个UINavigationController来推送视图。

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:addStoreViewController];

[self presentModalViewController:navController animated:YES];

then i push another view in the addStoreViewController here's the code: 然后我在addStoreViewController中推送另一个视图,这是代码:

PictureViewController *pictureViewController = [[PictureViewController alloc] init];    
[self.navigationController pushViewController:pictureViewController animated:YES];

finally, i want to use UIImagePickerController in pictureViewController here is the code from my camera button: 最后,我想在pictureViewController中使用UIImagePickerController,这是我的相机按钮的代码:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;

[self presentModalViewController:imagePicker animated:YES];

The level of my view controller: 我的视图控制器级别:

[UITabViewController] > [UINavigationController] -> [AddStoreViewController] -> [PictureViewController] > [UIImagePickerViewController] [UITabViewController]> [UINavigationController]-> [AddStoreViewController]-> [PictureViewController]> [UIImagePickerViewController]

Everything works fine but there's one thing weird. 一切正常,但有一件事很奇怪。 After presenting UIImagePickerViewController, other view will be affected with strage animation. 呈现UIImagePickerViewController之后,其他视图将受到分段动画的影响。 The whole UI in the view will display with an extra animation, like UITextField, UINavigationBar, UIButtons...everything you see on the view. 视图中的整个UI都将显示一个额外的动画,例如UITextField,UINavigationBar,UIButtons ...您在视图中看到的所有内容。 Even when you typing and the text will display with weird animation! 即使您输入文字,文字也会显示出怪异的动画! is there anything wrong with my code? 我的代码有什么问题吗? I googled this issue for a long time but can't find out. 我在这个问题上搜索了很长时间,但找不到。 could anyone help me? 谁能帮我吗? thank you so much! 非常感谢!

Oops i found the answer and im such an idiot... it was caused by my UIView Animation. 糟糕,我找到了答案,我是个白痴……这是由我的UIView动画引起的。 I forgot to insert this [UIView commitAnimations] in end of my animation. 我忘记在动画末尾插入[UIView commitAnimations]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM