简体   繁体   中英

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. But it won't show the navTools.

在此处输入图片说明

In the HTML I see that the buttons are still giving a css tag 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 .

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. 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.
  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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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