如何让项目 禁止横屏,默认竖屏。
本文章只介绍 如何让整个项目所有的页面都禁止横屏。如果想要某个页面默认竖屏,某个页面横屏。请持续关注更新。
方法一
看图操作:
在工程–>target–>general里面找到Depolyment Info,里面有个device o rientation,里面第一个点上,其他的都取消就是默认竖屏了
方法二
看图操作:
在AppDelegate.m中增加,这个方法可以禁止横屏
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return UIInterfaceOrientationMaskPortrait;
}
方法三
持续更新中…..