Weird Behavior on dismissing Modal View Controller

寵の児 提交于 2019-12-12 02:03:06

问题


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.

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:

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

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

Thanks


回答1:


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



来源:https://stackoverflow.com/questions/6554768/weird-behavior-on-dismissing-modal-view-controller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!