简体   繁体   English

ios-隐藏视图,但仍在其上启用用户交互

[英]ios - Hide a view but still enable user interaction on it

TL;DR: Is it possible to hide a view but keep the interaction on it enabled? TL; DR:是否可以隐藏视图但保持启用交互功能?

The case I'm facing is that I'm running an AR session with a AR SceneView which allows for the user to drop blocks and other items onto the screen. 我面临的情况是我正在使用AR SceneView运行AR会话,该会话允许用户将块和其他项目拖放到屏幕上。 I also am able to render this AR SceneView to a video. 我还可以将此AR SceneView渲染为视频。 My issue is that while I'm rendering the video, my AR objects seem to speeding up. 我的问题是,在渲染视频时,我的AR对象似乎在加速。 I've determined that this is a problem with the renderer forcing the sceneview to speed up to the rate at which it's generating images. 我确定这是渲染器强制场景视图加快生成图像速度的问题。

I have access to these images and figured a decent solution would be to display an ImageView and hide the sceneview while I'm recording, so that I can constantly update the image view with the latest snapshot from the AR, but the issue with that becomes that I can't click on my AR SceneView anymore to add objects to the AR Scene. 我可以访问这些图像,并认为一个不错的解决方案是在录制时显示ImageView并隐藏SceneView,以便可以不断使用AR中的最新快照更新图像视图,但是问题就变成了我无法再单击我的AR SceneView将对象添加到AR Scene。 So if I can hide the sceneview but still allow touches on it that would essentially fix my problem. 因此,如果我可以隐藏该场景视图,但仍然允许对其进行触摸,那基本上可以解决我的问题。

Any help would be appreciated 任何帮助,将不胜感激

而不是隐藏视图,为什么不将背景色设置为清除

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

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