Web视图在模拟器中加载但未在我的设备中加载(ios 8)

时间:2015-08-05 07:18:19

标签: ios webview device

网页视图在模拟器中正常加载但在我的设备中没有ios 8版本..这是我的代码

[super viewDidLoad];
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"BGColor.jpg"]];
self.navigationItem.title = textType;

//[self createHUD];
linkWebView = [[UIWebView alloc] init];
if(self.navigationController.viewControllers)
  linkWebView.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, phoneType-105);
else
   linkWebView.frame = CGRectMake(0, 0+60, [UIScreen mainScreen].bounds.size.width, phoneType-63);
linkWebView.delegate = self;
[self.view addSubview:linkWebView];

indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
indicator.frame = CGRectMake(([[UIScreen mainScreen] bounds].size.width/2)-18, ([UIScreen mainScreen].bounds.size.height/2)-45-15, 40, 40);
indicator.hidesWhenStopped = YES;
[indicator startAnimating];
[self.view addSubview:indicator];

urlStr = appDelegate.selectedURL;

if ([textType isEqualToString:@"About"])
{
    [linkWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/index/about.html?jsonFooter=hideHeaderFooter",urlStr]]]];//about.html

}

它在其他具有ios 6版本的设备中工作正常..为什么它在我的设备中不起作用?提前谢谢

1 个答案:

答案 0 :(得分:0)

“textType”肯定会是“关于”,大写“A”吗?尝试在条件中粘贴断点或NSLog()。另外,尝试将loadRequest参数分离到变量中,以便检查每个部分是否正确填充。