2014-12-05 106 views
4

我已经下载默认主详细模板从onsen ui当在设备中不集中,然后开发了一种科尔多瓦移动应用程序基于在导航条后援头标题集中在PC的浏览器和铬涟漪,但不在设备上。在设备上它会粘在左边。我添加了这种风格来看看发生了什么。导航栏文本使用温泉UI

.navigation-bar__center 
    { 
     text-align:center; 
     border:solid; 
     border-width:1px; 
    } 
    .navigation-bar 
    { 
     border:solid; 
     border-color:#f00; 
     border-width:1px; 
    } 

看起来头部的对应div没有拉伸。

这是在PC上的浏览器

enter image description here

而且这是对移动设备(三星机器人4.2)

enter image description here

PS。该问题存在于所有页面上。

+0

@Nima没有它不工作 – RezaRahmati 2014-12-05 21:25:05

回答

9

尝试使用导航栏上的标签fixed-style属性。像这样

<ons-toolbar fixed-style> 
    <div class="center"> 
    This will be centered 
    </div> 
</ons-toolbar> 

实际上,它不以设备为中心的原因是Onsen UI试图模拟原生行为。在Android上,导航栏标题不居中,但是左对齐。