美文网首页
iOS--webView加载本地错误html页面

iOS--webView加载本地错误html页面

作者: U9995 | 来源:发表于2017-07-11 10:23 被阅读44次
    - (void)viewDidLoad {
        [super viewDidLoad];
        CGRect bouds = [[UIScreen mainScreen] bounds];
        UIWebView *webView = [[UIWebView alloc] initWithFrame:bouds];
        NSURL *filePath = [[NSBundle mainBundle] URLForResource:@"www/error.html" withExtension:nil];
        NSURLRequest *request = [NSURLRequest requestWithURL:filePath];
        [webView loadRequest:request];
        webView.delegate = self;
        webView.scrollView.bounces = NO;
        [self.view addSubview:webView];
    }
    

    截图

    屏幕快照 2017-07-11 上午10.23.26.png

    相关文章

      网友评论

          本文标题:iOS--webView加载本地错误html页面

          本文链接:https://www.haomeiwen.com/subject/ojvphxtx.html