我一直在研究离子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;
}
}
}
答案 0 :(得分:1)
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 {