自动旋转
来源:互联网 发布:最全网络理财投资 编辑:程序博客网 时间:2024/04/28 17:10
自动旋转
自动旋转要注意合适性。
自动旋转的方法:
1.自动调整属性。
2.用CGRectMake重新调整位置。
3.用两张视图切换。
-(BOOL)shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation
{
....;
}
interfaceOrientation 可以是 UIInterfaceOrientationPortrait,
UIInterfaceOrientationLandscapeLeft,
UIInterfaceOrientationLandscapeRight,
UIInterfaceOrientationPortraitUpsideDown.
如果返回YES。则自动旋转。
1.用CGRectMake重新调整位置。
-(void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
duration:(NSTimeInterval)duration; //在旋转的后半个动画。
self.interfaceOrientation返回现在的方向。
button.frame属性为CGRect 框架的大小,位置。
动画效果:
[UIView beginAnimation:@"a" context:nil];
.
.
.
[UIView commitAnimation];
2.用两张视图切换。
删除原来视图,新建两个视图。
self.view返回当前的视图。
self.view.bounds返回视图的CGRect
self.view=self.view1; 把view1视图变成当前视图。
Core Graphics框架记得要导入。
CGAffineTransformMakeRotation(弧度).
self.view.transform=CGAffineTransformIdentity;
self.view.transform=CGAffineTransformMakeRotation(...);
- 自动旋转
- 关于自动旋转
- IOS自动旋转
- 屏幕旋转自动问题
- iphone自动旋转
- 自动旋转的圆环
- IOS 图片自动旋转
- IOS view 自动旋转
- 图片自动旋转
- 圆柱的自动旋转
- iOS自动旋转问题
- 自动旋转的太极图
- 自动旋转渐变圆环
- css自动旋转功能
- iOS手动旋转屏幕、自动旋转屏幕
- N82的自动屏幕旋转
- iphone 自动响应旋转屏幕
- 自动旋转和调整大小
- Java环境下Imagemagick中文图片处理问题非完美解决方案
- Google SEO优化技术的12个要点总结
- ASP 系列函数大全
- Complex LUW processing
- 手机客户端网络加速技术方案实现思考
- 自动旋转
- 在centos下用sendmail简单配置带smtp邮件服务器
- ASP.net服务器的入侵方法详解
- Linux内核 container_of 宏和 offsetof 宏分析
- int.Parse(),int.TryParse(),Convert.ToInt32(), (int)
- 奇怪的小加号
- Lua 的简单介绍
- Luna Wrapper 导出类
- Axis2.x WebService开发指南-目录索引