UIWebView loadHTMLString shows blank screen

孤人 提交于 2019-12-03 04:53:40

After a bit of detective work, I found out that returning NO in the delegate function

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

will reject loadHTMLString requests. Returning YES solved my problem.

mvishnu

I just had the same problem, and being a n00b, i found myself surprised that the problem was solved when i DID NOT DO

webview = [[UIWebView alloc]init];

but instead, since it was already wired up as an outlet, i just had to call

[webView loadHTMLString:mystring baseURL:nil];

From your initialization code for the UIWebView, it looks like you're adding wcbbcPanel at a position that would be off the screen. Try this instead:

wcbbcPanel = [[WarrantsAndCbbc alloc] initWithFrame:CGRectMake(0, 0, 320, 230)];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!