当前位置: 动力学知识库 > 问答 > 编程问答 >

iphone - How do I load webpage this way?

问题描述:

In a UIWebView, I provide a link to http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html. In the simulator, TOC doesn't load. A space for it appears then quickly hides. However, on the iPhone, TOC loads and doesn't hide. User has to click the hide TOC link. What is the simulator doing that the iPhone isn't? Is there a way to do that on the iPhone so TOC is hidden?

网友答案:

I don't know what the subtle difference is between the simulator and the device (something cookie related?), but I would suggest that your solution should be to wait until the page finishes loading and then inject the javascript to forcibly close the TOC, as with:

[webView stringByEvaluatingJavaScriptFromString:@"showHideTOC('hide');"];
分享给朋友:
您可能感兴趣的文章:
随机阅读: