Zoeken…


Een voorbeeldindeling toevoegen in uw app

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

Methode 1: Wereldwijde CSS

app.css - Geldt wereldwijd voor alle lay-outs.

StackLayout {
  margin: 10;
  background-color: white;
}
.btn, TextField {
  margin-left: 16;
  margin-right: 16;
}

Methode 2: Platformspecifieke CSS

platform.android.css - Geldt wereldwijd voor alle lay-outs in Android-apparaat.

.btn{
    background-color: #191919;
    color: #fff;
}

platform.ios.css - Geldt wereldwijd voor alle lay-outs in ios-apparaat.

.btn{
    background-color: #fff;
    color: #191919;
}

app.css

@import url("~/platform.css");

Methode 3: component-specifieke CSS

pages / main / main.android.css - Geldt voor specifieke component in Android-apparaat.

TextField {
  color: #e1e1e1;
  font-size: 12;
}

pages / main / main.ios.css - Geldt voor specifieke component in iOS-apparaat.

TextField {
  color: #e3e3e3;
  font-size: 15;
}

pages / main / main-common.css - Geldt voor specifieke componenten in alle apparaten.

TextField {
  padding: 4;
}


Modified text is an extract of the original Stack Overflow Documentation
Licentie onder CC BY-SA 3.0
Niet aangesloten bij Stack Overflow