NSString *path = [[NSBundle mainBundle] pathForResource:@"ad_type = 4" ofType:@"html"]; NSString *htmlStr = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil]; if (htmlStr != nil && [htmlStr rangeOfString:@"\\"].location != NSNotFound) { htmlStr = [htmlStr stringByReplacingOccurrencesOfString:@"\\" withString:@""]; } UIWebView *web = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 320, 50)]; [web loadHTMLString:htmlStr baseURL:nil]; [self.view addSubview:web];
时间: 2024-10-05 12:49:06