webView加载pdf

来源:互联网 发布:c语言简单表白代码 编辑:程序博客网 时间:2024/06/04 18:24
  1.   UIView *view = [[ UIView alloc] initWithFrame:[ UIScreen
  2.                                                    mainScreen].applicationFrame] ;
  3.     self.view = view;
  4.     CGRect webFrame = CGRectMake(0.0,0.0,350.0,450.0);
  5.     //webFrame.origin.y+=25;
  6.     UIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame];
  7.     [webView setBackgroundColor:[UIColor whiteColor]];//设置北京为白色
  8.     webView.scalesPageToFit = YES;//适应屏幕大小
  9.     NSString * strURL = @"http://blog.csdn.net/m_changgong";
  10.     NSURL * url = [NSURL URLWithString:strURL];
  11.     NSURLRequest * request = [NSURLRequest requestWithURL:url];
  12.     [webView loadRequest:request];
  13.     [self.view addSubview:webView];
  14.     [webView release];

    NSURL * url = [[NSBundle mainBundle] URLForResource:@"userProtocol" withExtension:@".rtf"];
    NSURLRequest * request = [NSURLRequest requestWithURL:url];
    [self.protoWebView loadRequest:request];

0 0
原创粉丝点击