使用modalPresentationStyle显示视图 [英] Display a view using modalPresentationStyle

查看:183
本文介绍了使用modalPresentationStyle显示视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说你可以使用modalPresentationStyle在iPad的邮件应用程序中创建一个视图弹出窗口。 Im有困难的时间了解如何使用它。我看了这个帖子这里,仍然无法弄清楚如何做这个任务。

I have heard that you can make a view popup like in the Mail app for iPad by using modalPresentationStyle. Im having a hard time figuring out how to use it though. I looked a this post here and still couldn't figure out how to do this task. If anyone could explain how to hook up the controllers to make this code work that would be great.

感谢

推荐答案

我认为神奇的咒语如下:

I think the magic incantation is the following:

myViewController = ..... create your new controller if needed ....
myViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
myViewController.modalPresentationStyle = UIModalPresentationFormSheet;
// "self" here is a ViewController instance
[self presentModalViewController:myViewController animated:YES]


b $ b

我似乎记得,在肖像模态接管了屏幕;在景观中,它将在视图中居中显示。

I seem to recall that in portrait the modal takes over the screen; in landscape it will be presented centered in the view.

这篇关于使用modalPresentationStyle显示视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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