本文介绍了肖像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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 15:54