离子2 App.Scss问题



我一直在使用一个月的Ionic 2应用程序工作。我通常在Android上进行测试,并且工作正常。我只是在iOS上跑了,设计是非常错误的。看起来它没有读取我用于全局CSS类的app.scss文件。知道什么问题是什么?

这是app.scss文件的示例

/***** Validation *****/
.error {
    background-color: $red;
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 10px 10px 10px 10px;
    color: white;
}
.error ion-icon {
    padding-right: 5px;
}
/***** Loading *****/
ion-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    .z-index {
        z-index: 2;
    }
}
/***** Menu *****/
.header-md::after, .tabs-md[tabsPlacement="top"] > .tabbar::after, .footer-md::before, .tabs-md[tabsPlacement="bottom"] > .tabbar::before {
    background-image: none;
}
ion-header {
    .navbar {
        padding: 0;
        box-shadow: 0 4px 2px -2px #aeaeae;
    }
    .navbarSection {
        padding: 8px 8px 0px 8px;
    }
    .menuSection {
        text-align: left;
        button:hover,
        button {
            color: white !important;
            div {
                margin-left: 10px;
            }
        }
    }
    .titleSection {
        text-align: center;
        ion-title h5 {
            font-size: 14px;
            color: white;
        }
    }
    .buttonsSection {
        text-align: right;
        button, button:hover {
            background-color: #ffffff !important;
            color: $black;
            font-weight: bolder;
            text-transform: none;
            font-size: 12px;
        }
        ion-icon {
            padding-left: 10px;
            padding-right: 10px;
            font-size: 16px;
        }
    }
    .categoriesSection {
        background-color: white;
        height: 42px;

        .filterSection {
            div {
                display: inline-block;
            }
            .filter-icon {
                color: $blue;
                margin-left: 15px;
                font-weight: bolder;
            }
            .filter-searchbar {
                position: relative;
                margin-left: 10px;
            }
        }
    }

app.scs中包含的某些样式似乎是特定于Android的。

eg:

.header-md::after, .tabs-md[tabsPlacement="top"] > .tabbar::after, .footer-md::before, .tabs-md[tabsPlacement="bottom"] > .tabbar::before {

使用-md后缀类仅针对Android设置。您将必须为-ios后缀设置类似的样式。

.header-ios::after, .tabs-ios[tabsPlacement="top"] > .tabbar::after, .footer-ios::before, .tabs-ios[tabsPlacement="bottom"] > .tabbar::before {

最新更新