From fd94d7149c22bca6e323de3e44d28a50d7bbf481 Mon Sep 17 00:00:00 2001
From: developer <developer@developerdeiMac.local>
Date: 星期五, 10 十一月 2023 17:41:30 +0800
Subject: [PATCH] 3.1.11版本

---
 BuWanVideo2.0/WEBViewController.m |   33 ++++++++++++++++++---------------
 1 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/BuWanVideo2.0/WEBViewController.m b/BuWanVideo2.0/WEBViewController.m
index 0b5e889..9291054 100755
--- a/BuWanVideo2.0/WEBViewController.m
+++ b/BuWanVideo2.0/WEBViewController.m
@@ -25,21 +25,21 @@
 
 - (void)viewDidLoad{
     [super viewDidLoad];
-    
     //鍋氱殑鍋囧鑸爮
-    _titleView=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, KScreenW, 64)];
-    _titleView.backgroundColor=kGlobalMainColor;
+    _titleView=[[UILabel alloc] initWithFrame:CGRectMake(0, 0 , KScreenW, 64 + kStatusBarH)];
+    _titleView.backgroundColor= kGlobalMainColor;
     _titleView.userInteractionEnabled=YES;
+    
     [self.view addSubview:_titleView];
     //娣诲姞缃戦〉閾炬帴
-    _urlView=[[UILabel alloc] initWithFrame:CGRectMake(50, 34, KScreenW-100, 24)];
+    _urlView=[[UILabel alloc] initWithFrame:CGRectMake(50, 34 , KScreenW-100, 24)];
     [_urlView setFont:[UIFont systemFontOfSize:12]];
     [_urlView setTextColor:[UIColor whiteColor]];
     _urlView.userInteractionEnabled=YES;
     [self.view addSubview:_urlView];
     
     //缃戦〉瑙嗗浘
-    _webView=[[WKWebView alloc] initWithFrame:CGRectMake(0, 64, KScreenW, KScreenH-64)];
+    _webView=[[WKWebView alloc] initWithFrame:CGRectMake(0, 64 , KScreenW, KScreenH - 64 )];
     _webView.contentMode=UIViewContentModeScaleAspectFill;
     _webView.configuration.allowsInlineMediaPlayback=YES;
     
@@ -62,10 +62,11 @@
     
     // 杩欒浠g爜鍙互鏄晶婊戣繑鍥瀢ebView鐨勪笂涓�绾э紝鑰屼笉鏄窡鎺у埗鍣紙*鎸囬拡瀵逛晶婊戞湁鏁堬級
     [_webView setAllowsBackForwardNavigationGestures:true];
+  
     [self.view addSubview:_webView];
     
     //娣诲姞杩斿洖鎸夐挳
-    _backBt=[[UIButton alloc] initWithFrame:CGRectMake(8, 22, 32, 32)];
+    _backBt=[[UIButton alloc] initWithFrame:CGRectMake(8, 22 + kStatusBarH , 32, 32)];
     [_backBt setImage:[UIImage imageNamed:@"璇︽儏椤甸潰杩斿洖"] forState:UIControlStateNormal];
     [_backBt addTarget:self action:@selector(backButtonPushed:) forControlEvents:UIControlEventTouchUpInside];
     [self.view addSubview:_backBt];
@@ -82,16 +83,18 @@
     [_webView addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL];
     [_webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:NULL];
     
-   
-    
-    
     [self loadwebViews];
+    
+//    UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, kStatusBarH , KScreenW, kStatusBarH)];
+//    view.backgroundColor=[UIColor redColor];
+//    [self.view addSubview:view];
 }
 
 - (void)viewWillAppear:(BOOL)animated{
     [super viewWillAppear:animated];
     //淇濇寔灞忓箷甯镐寒
     [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
+    [[UIApplication sharedApplication] setStatusBarHidden:YES];
 }
 
 -(void)viewWillDisappear:(BOOL)animated{
@@ -196,11 +199,11 @@
 }
 //鏀寔鐨勬柟鍚� 鍥犱负鐣岄潰A鎴戜滑鍙渶瑕佹敮鎸佺珫灞�
 - (UIInterfaceOrientationMask)supportedInterfaceOrientations{
-    _titleView.frame=CGRectMake(0, 0, KScreenWp, 64);
-    _urlView.frame=CGRectMake(50, 34, KScreenWp-100, 24);
-    _webView.frame=CGRectMake(0, 64, KScreenWp, KScreenHp-64);
-    _backBt.frame=CGRectMake(8, 22, 32, 32);
-    _reloadBt.frame=CGRectMake(KScreenWp-40, 22, 32, 32);
+    _titleView.frame=CGRectMake(0, 0, KScreenWp, 64 + kStatusBarH + (KIsiPhoneX?20:0));
+    _urlView.frame=CGRectMake(50, 34 + kStatusBarH + (KIsiPhoneX?20:0), KScreenWp-100, 24);
+    _webView.frame=CGRectMake(0, 64 + kStatusBarH + (KIsiPhoneX?20:0), KScreenWp, KScreenHp-64 - kStatusBarH - (KIsiPhoneX?20:0));
+    _backBt.frame=CGRectMake(8, 22 + kStatusBarH + (KIsiPhoneX?20:0), 32, 32);
+    _reloadBt.frame=CGRectMake(KScreenWp-40, 22 + kStatusBarH + (KIsiPhoneX?20:0), 32, 32);
     return _orMake;
 }
 
@@ -209,7 +212,7 @@
         if (object == _webView) {
             NSString *title = _webView.title;
             if(webtitle==nil){
-                webtitle=[[UILabel alloc] initWithFrame:CGRectMake(50, 15, KScreenW-100, 32)];
+                webtitle=[[UILabel alloc] initWithFrame:CGRectMake(50, 15 + kStatusBarH+ (KIsiPhoneX?20:0), KScreenW-100, 32)];
                 [webtitle setFont:[UIFont systemFontOfSize:14]];
                 [webtitle setTextColor:[UIColor whiteColor]];
                 [webtitle setTextAlignment:NSTextAlignmentLeft];

--
Gitblit v1.8.0