【问题标题】:Local html file load in UIWebviewUIWebview 中的本地 html 文件加载
【发布时间】:2011-06-15 12:18:54
【问题描述】:

我的 xcode 项目中有一个本地 html 文件。但我无法使用 UIWebView 加载该本地 html 文件。

【问题讨论】:

    标签: iphone ipad


    【解决方案1】:

    实现您的要求的代码是:

    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 
    self.view.frame.size.height,self.view.frame.size.width)];
    
    NSString *indexPath = [NSBundle pathForResource:@"index" ofType:@"html" inDirectory:nil];
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:indexPath]]];
    [self.view addSubview:webView];
    

    【讨论】:

      【解决方案2】:

      试试这个可能对你快乐编码有用:) 123

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-01-18
        • 2012-12-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-01-02
        相关资源
        最近更新 更多