肖像viewController后横向呈现presentModalViewController [英] presentModalViewController in landscape after portrait viewController

查看:89
本文介绍了肖像viewController后横向呈现presentModalViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个主ViewController一直处于纵向模式.

I have a main viewController that is in portrait mode all the time.

然后我想呈现ModalViewController,但是它将来自横向的左侧(而不是屏幕底部).

I want then to presentModalViewController, but it will come from the left (not from bottom of the screen) in landscape.

有可能吗?

tnx

推荐答案

在模态视图控制器实现中,覆盖-shouldAutorotateToInterfaceOrientation:

In your modal view controller implementation, override -shouldAutorotateToInterfaceOrientation:

- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

这篇关于肖像viewController后横向呈现presentModalViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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