webView、scrollView、TableView,为了防止滚动时出现偏移,底部黑框问题等

if ([self respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)]) {self.automaticallyAdjustsScrollViewInsets = NO;}

或者:_webView.opaque =NO;

具体场景如下:

- (void)viewDidLoad {

self.title = @"菜品详情页";

[super viewDidLoad];

self.view.backgroundColor = [UIColor whiteColor];

//加载web页面

[self addWebViewDemo];

}

-(void)addWebViewDemo{

_webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 64, JYEScreenWidth, JYEScreenHeight-64)];

NSURL *url = [[NSURL alloc]initWithString:@"http://www.baidu.com"];

NSURLRequest *request = [[NSURLRequest alloc]initWithURL:url];

[_webView loadRequest:request];

//if ([self respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)]) {self.automaticallyAdjustsScrollViewInsets = NO;}

_webView.opaque =NO;

_webView.scalesPageToFit = YES;

[self.view addSubview:_webView];

}

上一篇:.Class文件常量池小理解


下一篇:《安全智库》:48H急速夺旗大战通关writeup(通关策略)