MJRefresh icon indicating copy to clipboard operation
MJRefresh copied to clipboard

WKWebView 使用 AutoLayout 初次加载显示不全

Open Jasonjunjie opened this issue 2 years ago • 0 comments

描述bug WKWebView 使用 AutoLayout 初次加载显示不全

必现/偶发? 必现

//    self.webView = [[WKWebView alloc] initWithFrame:self.view.bounds];
//    self.webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    
    UIView *topView = [[UIView alloc] initWithFrame:CGRectZero];
    topView.backgroundColor = UIColor.yellowColor;
    [self.view addSubview:topView];
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(0);
        make.top.mas_equalTo(0);
        make.height.mas_equalTo(60);
    }];
    
    self.webView = [[WKWebView alloc] initWithFrame:CGRectZero];
    
    [self.view addSubview:self.webView];
    self.webView.navigationDelegate = self;
    
    [self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(0);
        make.top.mas_equalTo(topView.mas_bottom);
        make.bottom.mas_equalTo(0);
    }];

截图 IMG_7521

运行环境

  • iPhone12
  • iOS16.5
  • Xcode14.3.1

额外的 最好能提供出现bug的Demo MJRefreshExample.zip

Jasonjunjie avatar Aug 04 '23 06:08 Jasonjunjie