代码如下:
// 初始化WKWebView
_webView=[[WKWebView alloc]initWithFrame:CGRectMake(0,0,self.view.acs_width,self.view.acs_height-48)];_webView.navigationDelegate=self;_webView.alpha=0;[self.view insertSubview:_webView atIndex:0];self.headerView=[[UIView alloc]initWithFrame:CGRectMake(0,-429,self.view.frame.size.width,429)];// 设置偏移CGFloat height=_headerView.frame.size.height;_webView.scrollView.contentInset=UIEdgeInsetsMake(height,0,0,0);[_webView.scrollView addSubview:self.headerView];
网友评论