iPad在TabBarController上的全屏模式视图? [英] iPad Full Screen Modal View over TabBarController?

查看:253
本文介绍了iPad在TabBarController上的全屏模式视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iPad上基于TabBar的应用程序中,是否可以在全屏"中在其上方显示模式?

On a TabBar-based application on the iPad, is there a way to present a modal on top of it in "FullScreen"?

我有一个仅适用于LANDSCAPE的应用程序(如果有所不同),而我想以当前方式呈现的项目我想呈现全屏显示,填满整个屏幕只是为了澄清.我可以在"PageSheet"中很好地显示它,并且在模式视图笔尖上进行几次按钮调整之后,"FormSheet"就可以了,但是一旦我尝试了"FullScreen",背景就会变成白色(不过,TabBar仍然在那里),并且如果我重试该按钮(不重新启动模拟器),它将不会响应.

I have a LANDSCAPE ONLY APP (if that makes a difference) and the item I want to currently present modally I would like to present full screen, filling the entire screen just to clarify. I can present it in "PageSheet" fine, and "FormSheet" is all right, after a few button adjustments on the modal view nib, but once I try "FullScreen", the background goes white (TabBar still there, though), and if I retry hitting the button (without restarting the simulator), it won't respond.

用于显示模式视图的按钮所在的视图是CountryViewController.m并具有以下操作:

The view where the button is located to present the modal view is CountryViewController.m and has the action:

-(IBAction) showNewModal:(id)sender {
modalContent.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
modalContent.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController:modalContent animated:YES];
}

我意识到,如果没有TabBar,此代码也可以正常工作.我已经花了几个小时的时间在此代码中甚至在AppDelegate.h和.m文件中添加了一些内容,但到目前为止,它要么没有响应(足够多而没有显示错误),要么是上述空白.

This code works fine without the TabBar, I've realized. I've looked for hours for something to add to this code or even in the AppDelegate.h and .m files but so far, it's either unresponsive (oddly enough without showing an error) or the aforementioned white space.

推荐答案

以我的经验,问题出在从错误的控制器提供模态.

in my experience the problem comes from presenting the modal from the wrong controller.

[self.tabBarController presentModalViewController:modalContent animated:YES];

应该工作

如果您使用的是iOS 4,则最好使用以下选项:

If you work with iOS 4 a (maybe) beter options is to use:

[[UIApplication sharedApplication].keyWindow.rootViewController presentModalViewController:modalContent animated:YES];

这篇关于iPad在TabBarController上的全屏模式视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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