Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Modifier (UI) set default web modifier
-
Hey!
I was wondering: Is it possible to set the default modifier to “material” for components?
Now, when viewing in browser the UI is flat design. Is it possible to set this default to "material"
without specifically setting the modifier (so it doesn’t use material design on iOS).Regards,
Maxim
-
@Maxim-Van-de-Wynckel Hello! Modifier
material
is set if platform is ‘android’. You can force the platform by callingons.platform.select('android')
at the beginning of the app. You can also use these methods to filter platforms. For example:if (!ons.platform.isIOS()) { ons.platform.select('android'); }
I think that should display flat design for iOS and material design for the rest.
-
@Fran-Diox thanks for the great response! Works like charm
-
I do not find any ons object when I using react. What’s the equivalent codes in react for ons.platform.select(‘android’) ?
-
@Marcnuth It’s not attached to
window
by default, you need to import it:import ons from 'onsenui';
.