nativescript
서식 파일 서식 지정
수색…
앱에 샘플 레이아웃 추가하기
main.component.ts
import {Component} from "@angular/core";
@Component({
selector: "main",
template: `
<StackLayout>
<TextField hint="some text"></TextField>
<Button text="Click me" class="btn"></Button>
</StackLayout>
`,
styleUrls: ["pages/main/main-common.css", "pages/main/main.css"]
})
export class MainComponent { }
방법 1 : 전역 CSS
app.css - 모든 레이아웃에 전역 적으로 적용됩니다.
StackLayout {
margin: 10;
background-color: white;
}
.btn, TextField {
margin-left: 16;
margin-right: 16;
}
방법 2 : 플랫폼 별 CSS
platform.android.css - Android 기기의 모든 레이아웃에 전역 적으로 적용됩니다.
.btn{
background-color: #191919;
color: #fff;
}
platform.ios.css - ios 디바이스의 모든 레이아웃에 전역 적으로 적용됩니다.
.btn{
background-color: #fff;
color: #191919;
}
app.css
@import url("~/platform.css");
방법 3 : 구성 요소 관련 CSS
pages / main / main.android.css - 안드로이드 장치의 특정 구성 요소에 적용됩니다.
TextField {
color: #e1e1e1;
font-size: 12;
}
pages / main / main.ios.css - ios 장치의 특정 구성 요소에 적용됩니다.
TextField {
color: #e3e3e3;
font-size: 15;
}
pages / main / main-common.css - 모든 장치의 특정 구성 요소에 적용됩니다.
TextField {
padding: 4;
}
Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow