mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Include pages for formatted text with applied css in label, button, text field, text view
Update main-view-model
This commit is contained in:
committed by
Svetoslav Tsenov
parent
a640b969f3
commit
3102385f54
@@ -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;
|
||||
|
||||
15
apps/app/ui-tests-app/css/styled-formatted-text.css
Normal file
15
apps/app/ui-tests-app/css/styled-formatted-text.css
Normal 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;
|
||||
}
|
||||
43
apps/app/ui-tests-app/css/styled-formatted-text.xml
Normal file
43
apps/app/ui-tests-app/css/styled-formatted-text.xml
Normal 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>
|
||||
Reference in New Issue
Block a user