控制 UIViewController 界面方向
我有一个 UIViewController ,其中包含一个新的 UIViewController ,如下所示,
@implementation ParentViewController
- (id)init
{
// some stuff
}
- (BOOL)CreateChildViewController
{
UIViewController *childVC = [[UIViewController alloc] init];
}
@end
现在我需要停止 childVC 的界面方向。
可以吗,如果可以怎么办??
I have a UIViewController
which contains a new UIViewController
like below,
@implementation ParentViewController
- (id)init
{
// some stuff
}
- (BOOL)CreateChildViewController
{
UIViewController *childVC = [[UIViewController alloc] init];
}
@end
Now i need to stop interfaceOrientation of childVC.
Is it possible, if so how??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用:
任何视图控制器来确定自动旋转行为。
来自文档:
简而言之,如果您继承了
UIViewController
并且只想支持纵向,则无需执行任何操作。否则,您将需要添加此方法并决定是否允许旋转到另一个方向。阅读标题为“处理视图旋转”的部分。
Try using:
to any view controller to determine auto rotate behaviour.
From the documentation:
In short, if you subclass
UIViewController
and only want to support portrait, you don't need to do anything. Otherwise you will need to add this method and decide whether to allow rotation to another orientation.Read the section titled "Handling View Rotations".