简体   繁体   English

Forge Viewer工具栏按钮未隐藏在手机屏幕上

[英]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: 下列项目应具有可复制性:

  1. A short exact description of what you are trying to achieve. 对您要实现的目标的简短描述。 The behavior you observe versus what you expect, and why this is a problem. 您观察到的行为与期望的行为以及这是一个问题的原因。
  2. A complete yet minimal sample source model to run a test in. 完整而最少的样本源模型,可以在其中进行测试。
  3. A complete yet minimal Forge app that can be run and debugged with a simple procedure to analyze its behavior live in the sample model. 一个完整但最小的Forge应用程序,可以使用简单的过程运行和调试该应用程序,以在示例模型中实时分析其行为。
  4. Detailed step-by-step instructions for reproducing the issue, eg which element to pick, what command to launch etc. 重现问题的详细分步说明,例如,选择哪个元素,启动什么命令等。

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.

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