Browse Source

1.处理横屏时的底部按钮的显示

huangxiaodong 1 year ago
parent
commit
f4d8c71732

+ 18 - 8
创维盒子/双子星云手机/CloudPlayerWebRtc/webRtcVideoCallView.m

@@ -82,13 +82,22 @@ static CGFloat const kButtonSize = 48;
 }
 
 - (void)layoutSubviews {
-    CGRect bounds = self.bounds;
-    
- 
     //_mediaStream.frame =bounds;
-    _mediaStream.frame = CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT);
+    AppDelegate *app = (AppDelegate *)[UIApplication sharedApplication].delegate;
     
-    bottomContrView.frame = CGRectMake(0, SCREEN_H - TABBARHEIGHT, SCREEN_W, 47);
+    HLog(@"1111111111111:%f",SCREEN_W);
+    
+    if(app.isHorizontalScreentype){
+        _mediaStream.frame = CGRectMake(0, 0, SCREEN_W - TABBARHEIGHT, SCREEN_H);
+        bottomContrView.frame = CGRectMake(SCREEN_W - TABBARHEIGHT, 0, TABBARHEIGHT, SCREEN_H);
+        bottomContrView.transform = CGAffineTransformMakeRotation(-M_PI/2);
+    }
+    else{
+        _mediaStream.frame = CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT);
+        bottomContrView.frame = CGRectMake(0, SCREEN_H - TABBARHEIGHT, SCREEN_W, 47);
+        
+        bottomContrView.transform = CGAffineTransformMakeRotation(0);
+    }
     
     [mueBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(80.f);
@@ -102,9 +111,6 @@ static CGFloat const kButtonSize = 48;
         make.top.mas_equalTo(0);
     }];
 
-    UIImage  *backBtnImage = [UIImage imageNamed:@"fanhui_you_icon"];
-//        UIImage  *backBtnImage = [UIImage imageNamed:@"fanhui_icon"];
-    [backBtn setImage:backBtnImage forState:(UIControlStateNormal)];
     [backBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.right.mas_equalTo(-80.f);
         make.width.and.height.mas_equalTo(40.f);
@@ -156,6 +162,10 @@ static CGFloat const kButtonSize = 48;
     //测试说图片方向反了
     backBtn.imageView.transform = CGAffineTransformMakeRotation(M_PI);
     
+//    UIImage  *backBtnImage = [UIImage imageNamed:@"fanhui_you_icon"];
+////        UIImage  *backBtnImage = [UIImage imageNamed:@"fanhui_icon"];
+//    [backBtn setImage:backBtnImage forState:(UIControlStateNormal)];
+    
     /*第四个隐藏显示键*/
     UIImage  *showBtnImage = [UIImage imageNamed:@"showOrhide_home_icon"];
     showHomeBtn = [[UIButton alloc] init];