zoukankan      html  css  js  c++  java
  • 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];

    }

  • 相关阅读:
    jvm详解
    JVM堆外内存
    Guava基本使用
    Mondrian开源OLAP引擎详解
    Java8新特性简明教程
    TCP/IP协议三次握手和四次挥手详解
    Go 方法与函数区别
    Go 通道 Chan 详解
    kylin详细介绍
    计数排序
  • 原文地址:https://www.cnblogs.com/lrr0618/p/5203667.html
Copyright © 2011-2022 走看看