Include pages for formatted text with applied css in label, button, text field, text view

Update main-view-model
This commit is contained in:
SvetoslavTsenov
2017-05-12 18:53:09 +03:00
committed by Svetoslav Tsenov
parent a640b969f3
commit 3102385f54
6 changed files with 95 additions and 106 deletions

View File

@@ -46,6 +46,7 @@ export function pageLoaded(args: EventData) {
examples.set("textview-hint-color", "css/textview-hint-color");
examples.set("hint-text-color", "css/hint-text-color");
examples.set("combinators", "css/combinators");
examples.set("styled-formatted-text", "css/styled-formatted-text");
let viewModel = new SubMainPageViewModel(wrapLayout, examples);
page.bindingContext = viewModel;

View File

@@ -0,0 +1,15 @@
.class-style {
font-size:55;
color: red;
}
#id-style {
background-color: blue;
}
Label {
border-color:black;
border-radius: 25;
margin: 10px;
}

View File

@@ -0,0 +1,43 @@
<Page>
<Page.actionBar>
<ActionBar title="Text transform" class="action-bar"></ActionBar>
</Page.actionBar>
<StackLayout>
<Button class="class-style" id="id-style">
<Button.formattedText>
<FormattedString>
<FormattedString.spans>
<Span text="button"></Span>
</FormattedString.spans>
</FormattedString>
</Button.formattedText>
</Button>
<TextView class="class-style" id="id-style">
<TextView.formattedText>
<FormattedString>
<FormattedString.spans>
<Span text="text view"></Span>
</FormattedString.spans>
</FormattedString>
</TextView.formattedText>
</TextView>
<TextField class="class-style" id="id-style">
<TextField.formattedText>
<FormattedString>
<FormattedString.spans>
<Span text="text field"></Span>
</FormattedString.spans>
</FormattedString>
</TextField.formattedText>
</TextField>
<Label class="class-style" id="id-style">
<TextField.formattedText>
<FormattedString>
<FormattedString.spans>
<Span text="l a b e l"></Span>
</FormattedString.spans>
</FormattedString>
</TextField.formattedText>
</Label>
</StackLayout>
</Page>