2017-09-01 37 views
0

我使用离子框架在iOS和Android上构建应用程序。 问题是通常在Android上实现的ion-header-bar风格在iOS上非常糟糕。 以下是手机的屏幕截图。离子离子标题栏风格破坏ios

{左:IOS,右:机器人}

enter image description here

下面是在Safari调试的主页。

蓝色阴影区域是标题栏区域。

enter image description here

我不知道如果有,我必须单独指定的ios选项。或重写样式。

+0

你解决了你的问题? – shahnilay86

+0

@ shahnilay86我在我的答案中覆盖了样式代码,如下所示。感谢您的回复:) –

+0

你有试过我的代码吗?即'' – shahnilay86

回答

0

我通过覆盖sass文件解决了我的问题。 添加到ionic.app.sass文件的样式代码如下所示。

.platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader) 
    height: 84px 
    .platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader).item-input-inset .item-input-wrapper 
    margin-top: 19px !important 
    .platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader) > * 
    margin-top: 20px 

.platform-ios.platform-cordova:not(.fullscreen) .has-header, 
.platform-ios.platform-cordova:not(.fullscreen) .bar-subheader 
    top: 84px 

谢谢。

0

我认为你必须使用<ion-header>而不是<ion-header-bar>。同样在你的html文件中关闭相同的标签。

在我的项目中,它会正常工作,与<ion-header>

建议写入标签: -

当你去写那个时候一个标签<ion-header>也可以是可能的框架不会给你这个标签的建议。然后你也可以写和尝试给定的标签。

Hopy它会为你工作。