【腾讯云】云产品限时秒杀,爆款1核2G云服务器,首年99元

ionic browser+ios头部高度显示问题

ionic项目在使用ionic build browser或者打包ios时如果设置头部高度

方法如下

.bar-header {
  padding: 0;
  height: 0;
}

.scroll-content {
  top: 0;
}

更改之后在安卓和ionic serve下界面显示正常,但是在生成网页或者ios打开时,显示错版,原因是因为设置的header头部无效造成的,

查看源代码可以看到设置的样式被如下样式覆盖

.platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader)

解决方法,在run内部的$ionicPlatform.ready中添加ionic.Platform.fullScreen();

 

参考文档:

 

https://forum.ionicframework.com/t/ios-header-size-is-too-large/16127

posted @ 2016-11-02 17:36  happenzh  阅读(2361)  评论(0编辑  收藏  举报