Ionic 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.scss 中包含的某些样式似乎是特定于 android 的。

例如:

.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 {

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章