开发者

How to add a web view to the split view based application

开发者 https://www.devze.com 2023-04-08 02:23 出处:网络
How to add a web view to the root view controller in the split view based application. The following is the code which i am using,

How to add a web view to the root view controller in the split view based application. The following is the code which i am using,

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle ma开发者_如何学JAVAinBundle]pathForResource:@"rightview"ofType:@"html"]isDirectory:NO]]];

but in the output its not producing any output.


As it looks like an local html, you can also try doing it with loadHTMLString method like

[webView loadHTMLString:htmlString baseURL:nil];

load htmlString with the html content of your bundle html file.


You may also create a request using:

NSURL *url = [NSURL URLWithString:@"link"];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[[viewController webView] loadRequest:req];

Or something along those lines. You're going to have to tweak things a bit to have everything communicate properly. Just make sure you declare your webView in the App Delegate...

0

精彩评论

暂无评论...
验证码 换一张
取 消