NSString *str =[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSURL *url= [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/1.html",str]];
[self.webView loadHTMLString:[NSString stringWithFormat:@"%@",html] baseURL:url];
html是从数据库里读取的,baseUrl是伪造的路径,这样允许用户上传到程序的Documents下,但html调用的css在模拟器上可以显示,但在真机上显示不出来
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
人生最曼妙的风景,竟是内心的淡定与从容!