首页 > 其他 > 详细

屏幕旋转

时间:2016-01-27 21:29:50      阅读:168      评论:0      收藏:0      [点我收藏+]
 1 #import "MyView.h"
 2 
 3 @implementation MyView
 4 
 5 -(instancetype)initWithFrame:(CGRect)frame
 6 {
 7     if (self = [super initWithFrame:frame]) {
 8         _lable =[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
 9         _lable.backgroundColor = [UIColor redColor];
10         [self addSubview:_lable ];
11     }
12     return self;
13 }
14 
15 -(void)layoutSubviews
16 {
17     if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft || [UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeRight) {
18         
19         _lable.frame = CGRectMake(0, 0, 400, 30);
20         
21         
22     }else{
23 
24         _lable.frame = CGRectMake(0, 0, 100, 30);
25     }
26     NSLog(@"天天就知道旋转");
27 }
28 @end

 

屏幕旋转

原文:http://www.cnblogs.com/DevinSMR/p/5164429.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!