Webview空白,但有内容

编程入门 行业动态 更新时间:2024-10-20 08:35:09
本文介绍了Webview空白,但有内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我无法显示网络视图。我在自定义视图中有一个webview。我将此自定义视图加载为窗口的子视图,然后让一个对象控制器将文本字段链接到Web视图的内容。加载页面后,它将加载所有内容,但外观为白色。您可以单击链接。如果您观看Youtube视频,则可以收听,但仍不显示任何内容。 要加载自定义视图,请运行:

I am having trouble displaying a webview. I have a webview inside a custom view. I load this custom view as a subview of the window, and then have an object controller linking a text field to the content of the web view. Once a page is loaded, it loads all the content, but it is visually white. You can click on links. If you go to a Youtube video you can listen to it, but it still displays nothing. To load the custom view I run:

PageViewController *page = [[PageViewController alloc] initWithNibName:@"PageView" bundle:nil]; [page loadView]; [view addSubview:[page view]];

然后要加载页面,我有以下内容:

Then to load the page I have the following:

-(IBAction)connectURL:(id)sender { NSLog(@"connecting"); [webView setMainFrameURL:[sender stringValue]]; }

connectURL绑定到文本字段的位置。

Where connectURL is bound to a text field.

推荐答案

您是否已将自定义视图设置为分层支持?您不能在层支持的视图中使用 WebView 。如果不是问题,可以张贴自定义视图的绘图代码吗?

Have you set your custom view to be layer-backed? You can't use a WebView in a layer-backed view. If that's not the problem, can you post your custom view's drawing code?

更多推荐

Webview空白,但有内容

本文发布于:2023-10-16 16:30:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1498104.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:空白   内容   Webview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!