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];
  • 相关阅读:
    同一账号在不同浏览器不能同时登录
    子页面像父页面传递参数--数组
    bootstaptable动态合并单元格和jxls动态合并单元格
    RedisTemplate的使用
    java项目中读取配置文件
    httpclient调用接口
    drop、truncate和delete的区别
    函数式编程
    常见配置redis.conf介绍
    mysql和redis加入到windows服务
  • 原文地址:https://www.cnblogs.com/tom2015010203/p/5358653.html
Copyright © 2011-2022 走看看