【问题标题】:The UIWebView doesn't display urlUIWebView 不显示网址
【发布时间】:2011-05-27 13:37:19
【问题描述】:

我使用此代码加载 UIWebView:

NSString *a=@"http://www.google.com/";
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:a]];
[aWebView loadRequest:theRequest];

但是什么都没有加载?我做错了什么?

请帮帮我

【问题讨论】:

  • 请发布您添加 WebView 作为其他可见视图的子视图的代码。
  • +1 获得不错的潜意识广告
  • 你真的应该考虑提出一个问题。

标签: iphone url uiwebview


【解决方案1】:

试试这个代码可能会有所帮助............

   UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(50, 100, 690, 750)];
//webView.delegate=self;    
NSString *urlAddress = @"http://www.google.com/";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self.view addSubview:webView];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多