html 超链接不起作用,html - ios webview css和超链接在容器中的本地html文件中不起作用 - 堆栈内存溢出...

我有一个解决方案,但我不能保证它也适合你。 但我认为你可以尝试一下。

└─┬WKWebLoadLocalJS

|

└─┬WKWebLoadLocalJS

|

├─┬framework7-master

| |

| └─┬kitchen-sink

| |

| └─┬core

| |

| └──index.html

|

├──AppDelegate.h

|

├──AppDelegate.m

|

├──ViewController

|

|

└ …

- (void)loadLocalJS {

NSFileManager *fileManager = [NSFileManager defaultManager];

//Folder path in the project

NSString *directoryPath = [[NSBundle mainBundle] pathForResource:@"framework7-master" ofType:@""];

//Tmp cache folder path

NSString *tmpPath = NSTemporaryDirectory();

//Create a newDir (any name) folder under the tmp folder

NSString *newDir =@"newDir";

[fileManager createDirectoryAtPath:[tmpPath stringByAppendingString:newDir] withIntermediateDirectories:YES attributes:nil error:nil];

//The path to the newDir folder in tmp

NSString *tmp_newDir_path = [tmpPath stringByAppendingString:newDir];

//Copy folder to the tmp/newDir path

NSError*error;

NSString*txtPath =[tmp_newDir_path stringByAppendingPathComponent:@"framework7-master"];

if(![fileManager fileExistsAtPath:txtPath]){

NSLog(@"***** Copy folder to the tmp/newDir path:%d*****",[fileManager copyItemAtPath:directoryPath toPath:txtPath error:&error]);

}

//Tmp/newDir/FeedbackH5/pages/feedback.html full path

NSString *tmp_newDir_Feedback = [tmp_newDir_path stringByAppendingString:@"/framework7-master/kitchen-sink/core/index.html"];

//Convert path to URL

NSURL *feedbackURL = [NSURL fileURLWithPath:tmp_newDir_Feedback];

//WKWebView

[self.web loadRequest:[NSURLRequest requestWithURL:feedbackURL]];

}

如果你不明白,你可以看到这个例子 。

我希望它可以帮到你。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值