【问题标题】:ionic2 - ion-content to the top of the screenionic2 - 屏幕顶部的离子含量
【发布时间】:2017-03-10 21:38:18
【问题描述】:

我正在开发一个处理大量图像的移动应用。我的客户希望应用程序主页具有边缘到边缘的全屏背景图像。但到目前为止,我所能达到的效果如下图所示:

我只是不知道如何摆脱顶部的白色缝隙。这是我的代码:

home.html

<!--<ion-header>   <ion-navbar>
    <ion-title>
      Ionic Blank
    </ion-title>   </ion-navbar> </ion-header>-->

<ion-content>   <div class="gmHomeTopScreen">
    <p *ngIf="user">
      <i>Welcome, {{user}}</i>
    <p>
    <button class="button button-clear button-positive"  (click)="openModal({charNum: 0})">
      Gollum
    </button>   </div> </ion-content>

home.scss

page-home {

.gmHomeTopScreen{
 width: 100%;
 height: 100%;   
 background-color: #999;
}
}

我在ionicframework docs 中阅读了关于content 的内容,他们确实有一个名为contentTop 的实例成员。但我不知道如何使用它。

  1. 如何设置每个页面的顶部都带有ion-content?我知道这与 app.scss 有关,但我不知道该怎么做。

【问题讨论】:

  • 可以将margin-top: -15px !importantpadding-top: 0 !important; 添加到您的自定义类中
  • 奇怪。我什么也没做,空白消失了。我不知道它是如何工作的。

标签: html css angular ionic2


【解决方案1】:

尝试将fullscreen 属性添加到ion-content

【讨论】:

    猜你喜欢
    • 2017-12-23
    • 2018-04-16
    • 1970-01-01
    • 2015-04-09
    • 1970-01-01
    • 2011-12-25
    • 1970-01-01
    • 1970-01-01
    • 2021-09-18
    相关资源
    最近更新 更多