16-UIViewController 手动控制旋转
2015-07-09 20:44
701 查看
1.将4个勾勾上 默认控制器view都能4方向旋转 如需做特定旋转方向 执行第二步
//禁止旋转
- (BOOL)shouldAutorotate
{
return
NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
/*以home键为准上下左右
UIInterfaceOrientationMaskPortrait
正常状态 home键在下
UIInterfaceOrientationMaskPortraitUpsideDown
从下旋转 home键在上
UIInterfaceOrientationMaskLandscapeLeft home键在左面
UIInterfaceOrientationMaskLandscapeRight home键在右面
UIInterfaceOrientationMaskLandscape
支持左和右旋转
UIInterfaceOrientationMaskAllButUpsideDown
支持正常和左右旋转
UIInterfaceOrientationMaskAll
支持4个方向旋转
*/
return UIInterfaceOrientationMaskLandscapeRight;
}
//禁止旋转
- (BOOL)shouldAutorotate
{
return
NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
/*以home键为准上下左右
UIInterfaceOrientationMaskPortrait
正常状态 home键在下
UIInterfaceOrientationMaskPortraitUpsideDown
从下旋转 home键在上
UIInterfaceOrientationMaskLandscapeLeft home键在左面
UIInterfaceOrientationMaskLandscapeRight home键在右面
UIInterfaceOrientationMaskLandscape
支持左和右旋转
UIInterfaceOrientationMaskAllButUpsideDown
支持正常和左右旋转
UIInterfaceOrientationMaskAll
支持4个方向旋转
*/
return UIInterfaceOrientationMaskLandscapeRight;
}
相关文章推荐
- flex 控件的重要属性
- Delphi控件ListView的属性及使用方法详解
- web下载的ActiveX控件自动更新
- WinForm实现按名称递归查找控件的方法
- C#中父窗口和子窗口之间控件互操作实例
- MFC中动态创建控件以及事件响应实现方法
- WinForm自定义函数FindControl实现按名称查找控件
- WinForm拖拽控件生成副本的解决方法
- ASP.NET动态添加用户控件的方法
- ASP.NET的HtmlForm控件学习及Post与Get的区别概述
- WinForm实现移除控件某个事件的方法
- C#分屏控件用法实例
- jQuery操作表单常用控件方法小结
- C#的winform控件命名规范
- Jquery给基本控件的取值、赋值示例
- ASP.net 动态加载控件时一些问题的总结
- ASP.NET 4中的可扩展输出缓存(可以缓存页面/控件等)
- .NET中TextBox控件设置ReadOnly=true后台取不到值三种解决方法
- asp.net DataGrid控件中弹出详细信息窗口
- asp.net Repeater控件的说明及详细介绍及使用方法