【发布时间】:2014-02-27 04:40:29
【问题描述】:
我试图在我的应用程序中显示一个html 页面,但它没有显示在视图中:
NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask ,YES );
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"abt.html"];
NSURLRequest *documentsRequest = [NSURLRequest requestWithURL:
[NSURL fileURLWithPath:path]] ;
[_webview loadRequest:documentsRequest] ;
我点击了这个链接:iOS - display content from an html resource file or remote webpage in a webview
马特·吉布森
请告诉我如何显示。
谢谢
【问题讨论】:
-
这里可能有很多问题...webView 可能没有正确初始化,“Path”变量可能为空..您需要提供更多信息。