我有一个普通的NavigationController。 当我打开一个modalView(使用segues)并将其关闭时,来自NavigationController的所有下一个push和pop动画都会变得混乱。
基本上它只会动画导航栏,但该视图的内容不会动画(向左或向右)!
详细信息:
有谁知道发生了什么事?
一些代码(2.show modal):
- (void)sendFilesDidPick:(SendFilesType)type{
switch (type) {
case Library:
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]){
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
picker.allowsEditing = YES;
[self presentModalViewController:picker animated:YES];
}else {
////TODO: Tell user not available
}
break;
default:
break;
}
}
一些代码(3。):
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
[self dismissModalViewControllerAnimated:YES];
}
好的我有一个线索:在模态视图出现和解除后,所有其他可能消失的视图都不会调用“ViewWillDissapear”。这可能是杀死所有事情的原因..
答案 0 :(得分:2)
好的我发现了问题!
我有一个tabbar子类。 在我的子类中,我这样做:
- (void)viewDidAppear:(BOOL)animated {
//Custom code
}
我改为:
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
//Custom code
}
现在每件事似乎都能正常运作!!