iOS控制屏幕旋转
来源:互联网 发布:域名权重批量查询工具 编辑:程序博客网 时间:2024/05/15 05:52
- (BOOL) shouldAutorotate
{
return YES;
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
NSLog(@"kkkk");
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
NSLog(@"touch");
if (_b==NO) {
//这句话是防止手动先把设备置为横屏,导致下面的语句失效.
[[UIDevicecurrentDevice] setValue:[NSNumbernumberWithInteger:UIDeviceOrientationPortrait]forKey:@"orientation"];
[[UIDevicecurrentDevice] setValue:[NSNumbernumberWithInteger:UIDeviceOrientationLandscapeLeft]forKey:@"orientation"];
}
else
{
//横屏点击按钮,旋转到竖屏
[[UIDevicecurrentDevice] setValue:[NSNumbernumberWithInteger:UIDeviceOrientationLandscapeLeft]forKey:@"orientation"];//这句话是防止手动先把设备置为竖屏,导致下面的语句失效.
[[UIDevicecurrentDevice] setValue:[NSNumbernumberWithInteger:UIDeviceOrientationPortrait]forKey:@"orientation"];
}
// [self shouldAutorotate];
}
- [IOS] 屏幕旋转控制
- ios控制屏幕旋转
- iOS 屏幕旋转控制
- iOS 屏幕旋转控制
- iOS控制屏幕旋转
- iOS 屏幕自动旋转控制
- iOS控制屏幕旋转方向
- IOS 屏幕旋转控制详解-特酷吧
- iOS 屏幕旋转控制(iOS 9.1适用)
- android 屏幕旋转控制
- Android屏幕旋转控制
- 屏幕的旋转控制
- ios 6 的变化 与 旋转屏幕控制
- IOS疯狂基础之屏幕旋转控制,获得当前方向
- IOS疯狂基础之屏幕旋转控制,获得当前方向
- IOS疯狂基础之屏幕旋转控制,获得当前方向
- IOS&Android通用屏幕控制(移动旋转缩放)
- IOS&Android通用屏幕控制(移动旋转缩放)
- SpringMVC返回json数据的三种方式
- HTML <map> 设置图热点
- C++实验4-分数的累加
- 安卓开发空指针异常nullPointer的问题
- [IDF实验室] CTF手札-牛刀小试
- iOS控制屏幕旋转
- python-----os模块
- 按钮动画
- C语言练习之删除字符间多余的空格
- jQuery获取Select选择的Text和 Value(转)
- R语言︱机器学习模型评价指标+(转)模型出错的四大原因及如何纠错
- git详解
- 程序员的自我修养_之一_曾国藩的正面与侧面
- 主机访问虚拟机上的web服务器