简体   繁体   English

可可-NSTabView中的WebViews

[英]Cocoa - WebViews inside NSTabView

I am developing an application with an NSTabView with multiple NSTabViewItems. 我正在开发具有多个NSTabViewItems的NSTabView的应用程序。 Each of the NSTabViewItems has a WebView subview. 每个NSTabViewItems都有一个WebView子视图。 The WebView works as expected except when Flash or Silverlight are running in one of the WebViews. 除了Flash或Silverlight在其中一个WebView中运行时,WebView均按预期工作。 If, while Flash or Silverlight are running, a different tab is selected, the media will stop. 如果在运行Flash或Silverlight时选择了其他选项卡,则媒体将停止。 When that tab is selected again, the media will restart. 再次选择该选项卡后,媒体将重新启动。 Is there any way around this (ie to allow the media to continue to run when a different NSTabViewItem is selected)? 有什么办法解决(即,当选择了另一个NSTabViewItem时,允许媒体继续运行)吗? Does the NSTabViewItem send a message to its subviews when a different NSTabViewItem has been selected? 选择了另一个NSTabViewItem时,NSTabViewItem是否将消息发送到其子视图?

I'm not sure if this is why, but try check your webviews if their shouldUpdateWhileOffscreen is enabled. 我不确定这是否是为什么,但是请尝试检查您的Web shouldUpdateWhileOffscreen是否启用了shouldUpdateWhileOffscreen If it's enabled but the other tabs still doesn't load, then I'm guessing it's the design of the NSTabView, which is something on the lines of encoding it when the tab switches away, then decoding it when the user selects that tab again. 如果启用了它,但其他选项卡仍然没有加载,那么我猜这是NSTabView的设计,这是在选项卡关闭时对其进行编码的东西,然后在用户再次选择该选项卡时对其进行解码。 In that case, I would probably do something like having a NSTabView with empty views and put the WebViews as subviews of the content view, overlaying each other and set the WebViews as hidden/visible whenever another tabview is selected. 在那种情况下,我可能会做一些事情,例如让NSTabView带有空视图,然后将WebView放置为内容视图的子视图,彼此重叠,并在每次选择另一个tabview时将WebView设置为隐藏/可见。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM