控制当前控制器支持哪些方向
2015-12-02 14:29
169 查看
2015-12-0214:28:59
#pragma mark - 实现这个方法来控制屏幕方向
/**
* 控制当前控制器支持哪些方向
* 返回值是UIInterfaceOrientationMask*
*/
- (NSUInteger)supportedInterfaceOrientations
{
/**
* UIInterfaceOrientationMaskPortrait : 竖屏(正常)
* UIInterfaceOrientationMaskPortraitUpsideDown : 竖屏(上下颠倒)
* UIInterfaceOrientationMaskLandscapeLeft : 横屏向左
* UIInterfaceOrientationMaskLandscapeRight : 横屏向右
* UIInterfaceOrientationMaskLandscape : 横屏(横屏向左\横屏向右)
* UIInterfaceOrientationMaskAll : 全部方向(包括上面的所有情况)
*/
return UIInterfaceOrientationMaskPortrait;
}
注意点:如果当前控制器在导航控制下 那么要重写导航控制器的这个方法,重写当前控制器的这个方法没作用。
#pragma mark - 实现这个方法来控制屏幕方向
/**
* 控制当前控制器支持哪些方向
* 返回值是UIInterfaceOrientationMask*
*/
- (NSUInteger)supportedInterfaceOrientations
{
/**
* UIInterfaceOrientationMaskPortrait : 竖屏(正常)
* UIInterfaceOrientationMaskPortraitUpsideDown : 竖屏(上下颠倒)
* UIInterfaceOrientationMaskLandscapeLeft : 横屏向左
* UIInterfaceOrientationMaskLandscapeRight : 横屏向右
* UIInterfaceOrientationMaskLandscape : 横屏(横屏向左\横屏向右)
* UIInterfaceOrientationMaskAll : 全部方向(包括上面的所有情况)
*/
return UIInterfaceOrientationMaskPortrait;
}
注意点:如果当前控制器在导航控制下 那么要重写导航控制器的这个方法,重写当前控制器的这个方法没作用。
相关文章推荐
- pom文件中的内置变量
- 关于The function get must be used with a prefix when a default namespace is not specified的错误
- 神经网络激励函数的形象解释
- 架构师之路(1)---面向过程和面向对象
- eclipse中把多个项目放在一个work set下
- 关于齐次坐标系
- 安装完Redis服务后,远程连接报连接超时错误
- 优先队列,由于优先队列的树形结构是完全二叉树,所以可以使用数组的形式去存储,我的上一个博客是用二叉树的形式去存储优先队列的
- Android常用权限permission列表摘录
- 判断单选框是否被选中
- restFul get url
- C++11 JNI开发中RAII的应用(一)--制作基础工具
- Codeforces Round #334 (603B) Moodular Arithmetic [基础数学]
- 【智能路由器】轻量级web服务器lighttpd架设——打造家庭影院
- 如何优化 Android Studio 启动、编译和运行速度?
- rzsz的编译安装及SecureCR下Zmodem传输用法
- JMeter监控Tomcat性能 【转载】
- BZOJ2750: [HAOI2012]Road
- apache htaccess
- 通过非聚集索引让select count(*) from 的查询速度提高几十倍、甚至千倍