关闭模态视图控制器的奇怪行为 [英] Weird Behavior on dismissing Modal View Controller

查看:30
本文介绍了关闭模态视图控制器的奇怪行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一篇文章,潜伏了一段时间阅读.我有一个应用程序需要访问设备上的联系人,这可以正常工作,但是当我关闭控件时,它消失了,但我的应用程序上的其他元素也丢失了.

First post, have been lurking for a while reading. I have an app that needs to access the contacts on the device and this works ok, however when I dismiss the control, it goes away but I also lose other elements on my app.

我有一个包含 1 个主视图的视图控制器,它有一个作为页眉的导航栏和一个作为页脚的标签栏.我有一个覆盖视图,其中包含触发地址簿组件的按钮.当关闭发生时,标签栏和导航栏与组件一起消失!

I have a View Controller that contains 1 main view, this has a navigation bar as a header and a tab bar as a footer. I have an overlay view that contains the button to trigger the address book component. When the dismiss happens, the tab bar and nav bar disappear with the component!

这是我用来显示地址簿的代码:

This is the code I am using to show the address book:

代码:ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];picker.peoplePickerDelegate = self;[self presentModalViewController:picker 动画:YES];并因此被驳回:

Code: ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; picker.peoplePickerDelegate = self; [self presentModalViewController:picker animated:YES]; and dismissed with this:

代码:[自我解雇ModalViewControllerAnimated:YES];很简单的东西.什么会导致dismiss 命令不仅仅是删除模态控制器?

Code: [self dismissModalViewControllerAnimated:YES]; pretty simple stuff. What could cause the dismiss command to do more than just remove the modal controller?

谢谢

推荐答案

Trypresent modal controller from tabBarController like [self.tabBarController presentModal...];

Try presenting modal controller from tabBarController like [self.tabBarController presentModal...];

这篇关于关闭模态视图控制器的奇怪行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆