zoukankan      html  css  js  c++  java
  • UIWebView

            UIWebView *view = [[UIWebView alloc] initWithFrame:kScreenBounds];

            [view setUserInteractionEnabled:YES];

            [view setScalesPageToFit:YES];

            [self.view addSubview:view];

            

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

            [view loadRequest:[NSURLRequest requestWithURL:url]];

     

     

    //2.加载本地文件资源
       /* NSURL *url = [NSURL fileURLWithPath:filePath];
      NSURLRequest *request = [NSURLRequest requestWithURL:url];
      [webView loadRequest:request];*/
      //3.读入一个HTML,直接写入一个HTML代码
      //NSString *htmlPath = [[[NSBundle mainBundle]bundlePath]stringByAppendingString:@"webapp/loadar.html"];
      //NSString *htmlString = [NSString stringWithContentsOfURL:htmlPath encoding:NSUTF8StringEncoding error:NULL];
      //[webView loadHTMLString:htmlString baseURL:[NSURL fileURLWithPath:htmlPath]];
      
      opaqueView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
      activityIndicatorView = [[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
      [activityIndicatorView setCenter:opaqueView.center];
      [activityIndicatorView setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite];
      [opaqueView setBackgroundColor:[UIColor blackColor]];
      [opaqueView setAlpha:0.6];
      [self.view addSubview:opaqueView];
      [opaqueView addSubview:activityIndicatorView];
  • 相关阅读:
    python基础
    目标文件格式
    PHP 计算每个月的最后一天
    学习应该专注于学习这件事上
    以 Composer 的方式在 PhpStorm 中添加代码审查工具 Code Sniffer
    开始在博客园写文章啦!
    Git 常用操作
    常用写作格式
    将公司的主要项目从eclipse迁移到android studio for mac环境(1)
    写随笔、博客的心情
  • 原文地址:https://www.cnblogs.com/tom2015010203/p/5358653.html
Copyright © 2011-2022 走看看