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];
  • 相关阅读:
    人这一辈子
    理性不是逆来顺受
    旧瓶新酒:江城子
    HVAC专业相关网站
    韩寒:主子,奴才和狗
    百无一用是书生
    inove主题文章字体修改
    这个世界清净了:再见人人
    ActiveX控件开发(转)
    GIS大讲堂内所有讲座的索引(更新至2008年6月26日)(转)
  • 原文地址:https://www.cnblogs.com/tom2015010203/p/5358653.html
Copyright © 2011-2022 走看看