[英]Forge Viewer toolbar buttons not hiding on mobile phone screen
I am trying to adjust the buttons to only show the navigation tools when the device is a mobile phone. 我正在尝试将按钮调整为仅在设备为手机时显示导航工具。 I'm using the following code:
我正在使用以下代码:
viewer.toolbar.getControl('settingsTools').setVisible(false);
viewer.toolbar.getControl('modelTools').setVisible(false);
viewer.toolbar.getControl('navTools').setVisible(true);
viewer.toolbar.getControl('navTools').getControl('toolbar-orbitTools').setVisible(true);
But then it will remove the visible buttons which were the SettingsTools and half of the modelTools. 但随后它将删除可见的按钮,即SettingsTools和modelTools的一半。 But it won't show the navTools.
但是它不会显示navTools。
In the HTML I see that the buttons are still giving a css tag display: none
在HTML中,我看到按钮仍然
display: none
css标签display: none
How can I make this work? 我该如何进行这项工作?
EDIT: I have changed the logic to directly change the CSS (display = none or block) as per this example http://through-the-interface.typepad.com/through_the_interface/2017/03/hiding-unwanted-toolbar-items-in-the-forge-viewer.html . 编辑:我已更改逻辑,以根据此示例直接更改CSS(显示=无或阻止) http://through-the-interface.typepad.com/through_the_interface/2017/03/hiding-unwanted-toolbar-items -in-the-forge-viewer.html 。
Using this causes the button to be arranged and styled weird. 使用此按钮会使按钮排列和样式怪异。 Is there a method I need to call to let the viewer update its outlining etc?
我需要调用一种方法来让查看器更新其轮廓等吗?
I found that it also works properly on my Android 6.0 device with the Google Chrome and the viewer v2.13. 我发现它在带有谷歌浏览器和查看器v2.13的Android 6.0设备上也可以正常工作。 I have no explanation for the visibility of the button control in your device.
对于您设备中按钮控件的可见性,我没有任何解释。
If you can provide a reproducible case demonstrating that, I will gladly pass it on to the development team for analysis. 如果您可以提供一个可重复的案例来证明这一点,我很乐意将其传递给开发团队进行分析。 Those following items should be in the reproducible case:
下列项目应具有可复制性:
If your reproducible case could not be posted here publicly, please send it to the forge.help@autodesk.com
and remove sensitive data or information before you send . 如果您的可复制案例无法在此处公开发布,请在发送之前将其发送至
forge.help@autodesk.com
并删除敏感数据或信息 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.