重温自动旋转和自动调整大小
来源:互联网 发布:贪心算法举例 编辑:程序博客网 时间:2024/05/03 00:06
问题描述:
原来是这样子写的
if (interfaceOrientation == UIInterfaceOrientationPortrait ||interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
NSLog(@"myPortrait before:%@",myPortrait);
DerictionV = 1;
// logonView.view = logonView.portrait;
self.view = myPortrait;
scrollView_P.contentSize = CGSizeMake(scrollView_P.bounds.size.width, scrollView_P.bounds.size.height+200);
NSLog(@"myPortrait after:%@",myPortrait);
}
else{
NSLog(@"myLandscape before:%@",myLandscape);
DerictionV = 0;
// logonView.view = logonView.landscape;
self.view = myLandscape;
scrollView_L.contentSize = CGSizeMake(scrollView_L.bounds.size.width, scrollView_L.bounds.size.height+200);
NSLog(@"myLandscape after:%@",myLandscape);
}
2012-12-03 11:18:34.786 CPL_OA[2606:f803] myLandscape after:<UIView: 0xbaf7120; frame = (20 0; 748 1024); autoresize = W+H; layer = <CALayer: 0xbaf7150>>
2012-12-03 11:18:34.786 CPL_OA[2606:f803] DerictionV:0
2012-12-03 11:18:35.658 CPL_OA[2606:f803] myPortrait after:<UIView: 0xbafa3b0; frame = (-118 118; 1004 768); autoresize = W+H; layer = <CALayer: 0xbafa3e0>>
2012-12-03 11:18:35.659 CPL_OA[2606:f803] DerictionV:1
2012-12-03 11:18:36.281 CPL_OA[2606:f803] myLandscape after:<UIView: 0xbaf7120; frame = (20 0; 748 1024); autoresize = W+H; layer = <CALayer: 0xbaf7150>>
2012-12-03 11:18:36.281 CPL_OA[2606:f803] DerictionV:0
2012-12-03 11:18:36.862 CPL_OA[2606:f803] myPortrait after:<UIView: 0xbafa3b0; frame = (-118 118; 1004 768); autoresize = W+H; layer = <CALayer: 0xbafa3e0>>
2012-12-03 11:18:36.863 CPL_OA[2606:f803] DerictionV:1
2012-12-03 11:18:37.681 CPL_OA[2606:f803] myLandscape after:<UIView: 0xbaf7120; frame = (20 0; 748 1024); autoresize = W+H; layer = <CALayer: 0xbaf7150>>
2012-12-03 11:18:37.682 CPL_OA[2606:f803] DerictionV:0
2012-12-03 11:18:38.296 CPL_OA[2606:f803] myPortrait after:<UIView: 0xbafa3b0; frame = (-118 118; 1004 768); autoresize = W+H; layer = <CALayer: 0xbafa3e0>>
2012-12-03 11:18:38.296 CPL_OA[2606:f803] DerictionV:1
2012-12-03 11:18:38.940 CPL_OA[2606:f803] myLandscape after:<UIView: 0xbaf7120; frame = (20 0; 748 1024); autoresize = W+H; layer = <CALayer: 0xbaf7150>>
2012-12-03 11:18:38.941 CPL_OA[2606:f803] DerictionV:0
2012-12-03 11:18:39.537 CPL_OA[2606:f803] myPortrait after:<UIView: 0xbafa3b0; frame = (-118 118; 1004 768); autoresize = W+H; layer = <CALayer: 0xbafa3e0>>
2012-12-03 11:18:39.538 CPL_OA[2606:f803] DerictionV:1
2012-12-03 11:18:40.126 CPL_OA[2606:f803] myLandscape after:<UIView: 0xbaf7120; frame = (20 0; 748 1024); autoresize = W+H; layer = <CALayer: 0xbaf7150>>
2012-12-03 11:18:40.127 CPL_OA[2606:f803] DerictionV:0
2012-12-03 11:18:40.595 CPL_OA[2606:f803] myPortrait after:<UIView: 0xbafa3b0; frame = (-118 118; 1004 768); autoresize = W+H; layer = <CALayer: 0xbafa3e0>>
2012-12-03 11:18:40.596 CPL_OA[2606:f803] DerictionV:1
2012-12-03 11:18:41.070 CPL_OA[2606:f803] myLandscape after:<UIView: 0xbaf7120; frame = (20 0; 748 1024); autoresize = W+H; layer = <CALayer: 0xbaf7150>>
2012-12-03 11:18:41.071 CPL_OA[2606:f803] DerictionV:0
2012-12-03 11:18:41.530 CPL_OA[2606:f803] myPortrait after:<UIView: 0xbafa3b0; frame = (-118 118; 1004 768); autoresize = W+H; layer = <CALayer: 0xbafa3e0>>
2012-12-03 11:18:41.531 CPL_OA[2606:f803] DerictionV:1
碰到个相关的问题,查阅了相关view的只是,无解,于是乎捡起旧书本,记录于此。
内部正方形,实线,自由改变宽度;虚线,竟可能原值。
四周的四个红色“I”。如果“I”是虚线,那么距离就是灵活可变的;如果“I”是红色实线,则间距的值应尽可能保持不变。
内部和外部是相反的,注意到没。略微有点忘了。平时都是看动画的。(这段跟整个问题无关,看书的时候看到,又有点忘了,顺便记录一下)
抄了书上的代码,就ok了。
if (toInterfaceOrientation==UIInterfaceOrientationPortrait) {
DerictionV = 1;
self.view=self.myPortrait;
self.view.transform=CGAffineTransformIdentity;
self.view.transform=CGAffineTransformMakeRotation(degreesToRadians(0));
self.view.bounds=CGRectMake(0.0, 0.0, 768.0, 1024.0);
}
if (toInterfaceOrientation==UIInterfaceOrientationLandscapeLeft) {
DerictionV = 0;
self.view=self.myLandscape;
self.view.transform=CGAffineTransformMakeRotation(degreesToRadians(0));
self.view.transform=CGAffineTransformMakeRotation(degreesToRadians(-90));
self.view.bounds=CGRectMake(0.0, 0.0, 1024.0, 768.0);
}
if (toInterfaceOrientation==UIInterfaceOrientationPortraitUpsideDown) {
DerictionV = 1;
self.view=self.myPortrait;
self.view.transform=CGAffineTransformMakeRotation(degreesToRadians(180));
self.view.bounds=CGRectMake(0.0, 0.0, 768.0, 1024.0);
}
if (toInterfaceOrientation==UIInterfaceOrientationLandscapeRight) {
DerictionV = 0;
self.view=self.myLandscape;
self.view.transform=CGAffineTransformMakeRotation(degreesToRadians(90));
self.view.bounds=CGRectMake(0.0, 0.0, 1024.0, 768.0);
}
- 重温自动旋转和自动调整大小
- 自动旋转和调整大小
- 自动旋转和调整大小
- Fifth-自动旋转和自动调整大小
- iphone有关旋转和自动调整大小
- IPhone学习笔记五-----自动旋转和自动调整大小
- 自动旋转与自动调整大小
- 《Iphone开发基础教程》第五章 自动旋转和调整大小
- 《Iphone开发基础教程》第五章 自动旋转和调整大小
- 《Iphone开发基础教程》第五章 自动旋转和调整大小
- IOS5基础之四-----自动旋转和调整大小
- iOS开发:自动旋转与调整大小
- iOS开发:自动旋转与调整大小
- iOS开发:自动旋转与调整大小
- iPhone开发基础教程笔记(四)--第五章 自动旋转和自动调整大小
- iOS开发7:自动旋转与调整大小
- iOS开发7:自动旋转与调整大小
- iOS开发7:自动旋转与调整大小
- BadTokenException: Unable to add window -- token android.os.BinderProxy@438e7108 is not valid;
- uva 11552 - Fewest Flops(dp)
- plsql工具执行更新提交时,没有提示 “提交当前事务”提示框问题
- C语言字符串,字符转数字,数字转字符
- [Leetcode] Merge k Sorted Lists
- 重温自动旋转和自动调整大小
- 业务流程建模标注(BPMN)详细介绍
- Facade门面模式
- linux时间编程常用函数
- Xcode使用教程
- [项目管理] CentOS VPS上安装SVN服务器
- 让GridView拥有Gallery的拖动功能
- 简单Blog项目笔记之四:用户注册、分配用户名对应的域名
- 使用友盟SNS_SDK为Android应用加入SNS分享、同步功能