i am designing a page in mobile app using ONSEN UI. in page, i have used onsen toolbar. the problem i am facing is the text i am writing doesn't come in center even if i write that using center class. i tried some alternative solutions like, "text-allign=center", text , but none worked. please show me some way using which i can keep text in center. p.s. - i am developing the app in android environment, have tested the app on emulator and device both. here is the code i have written for toolbar.
<ons-toolbar style="background-color:#000;opacity:0.5; ">
<div class="center" style="color:white">Some Text</div>
</ons-toolbar>
Use the attribute fixed-style
to center the toolbar on Android:
<ons-toolbar fixed-style>
<div class="center">
Centered title
</div>
</ons-toolbar>
The reason why it isn't centered on Android is that for native Android apps the title is often left-aligned. Of course, there are exceptions.