File tree Expand file tree Collapse file tree 4 files changed +47
-1
lines changed
apps/app/ui-tests-app/css
tns-core-modules/ui/text-base Expand file tree Collapse file tree 4 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 1+ import { EventData , TextBase } from "tns-core-modules/ui/text-base" ;
2+
3+ const values = [ 3 , 7 , 13 ] ;
4+
5+ export function buttonTap ( args : EventData ) {
6+ let page = ( < TextBase > args . object ) . page ;
7+ let lbl = < TextBase > page . getViewById ( "label" ) ;
8+ let btn = < TextBase > page . getViewById ( "button" ) ;
9+ let tv = < TextBase > page . getViewById ( "textView" ) ;
10+ let ft = < TextBase > page . getViewById ( "formattedText" ) ;
11+
12+ let index = values . indexOf ( lbl . lineHeight ) ;
13+ let newIndex = ( index + 1 ) % values . length ;
14+ let newValue = values [ newIndex ] ;
15+
16+ lbl . lineHeight = newValue ;
17+ btn . lineHeight = newValue ;
18+ tv . lineHeight = newValue ;
19+ ft . lineHeight = newValue ;
20+ }
Original file line number Diff line number Diff line change 1+ <Page >
2+ <StackLayout >
3+ <Button automationText =" Change" text =" Change" tap =" buttonTap" />
4+ <Label automationText =" label" id =" label" textWrap =" true" style =" text-decoration: underline; text-transform: capitalize; letter-spacing: 0.1; line-height: 7;"
5+ text =" The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog." />
6+ <Button automationText =" button" id =" button" ios : textWrap =" true" style =" text-decoration: underline; text-transform: capitalize; letter-spacing: 0.1; line-height: 7;"
7+ text =" The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog." />
8+ <TextView automationText =" textView" id =" textView" style =" text-decoration: underline; text-transform: capitalize; letter-spacing: 0.1; line-height: 7;"
9+ text =" The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog." />
10+ <Label automationText =" formattedText" id =" formattedText" textWrap =" true" style =" text-decoration: underline; text-transform: capitalize; letter-spacing: 0.1; line-height: 7;" >
11+ <Label .formattedText>
12+ <FormattedString >
13+ <FormattedString .spans>
14+ <Span text =" The quick brown fox jumps over the lazy dog." style =" font-weight: bold; color: green;" />
15+ <Span text =" The quick brown fox jumps over the lazy dog." style =" font-style: italic; color: blue;" />
16+ </FormattedString .spans>
17+ </FormattedString >
18+ </Label .formattedText>
19+ </Label >
20+ </StackLayout >
21+ </Page >
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export function loadExamples() {
1414 examples . set ( "formatted" , "css/decoration-transform-formattedtext" ) ;
1515 examples . set ( "radius" , "css/radius" ) ;
1616 examples . set ( "spacing" , "css/letter-spacing" ) ;
17+ examples . set ( "line-height" , "css/line-height" ) ;
1718 examples . set ( "decoration" , "css/text-decoration" ) ;
1819 examples . set ( "transform" , "css/text-transform" ) ;
1920 examples . set ( "whitespace" , "css/white-space" ) ;
@@ -39,6 +40,5 @@ export function loadExamples() {
3940 examples . set ( "styled-formatted-text" , "css/styled-formatted-text" ) ;
4041 examples . set ( "non-uniform-radius" , "css/non-uniform-radius" ) ;
4142 examples . set ( "missing-background-image" , "css/missing-background-image" ) ;
42-
4343 return examples ;
4444}
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ export class TextBase extends View implements AddChildFromBuilder {
2929 */
3030 letterSpacing : number ;
3131
32+ /**
33+ * Gets or sets lineHeight style property.
34+ */
35+ lineHeight : number ;
36+
3237 /**
3338 * Gets or sets text-alignment style property.
3439 */
You can’t perform that action at this time.
0 commit comments