TextView It's a simple class to show a piece of text. You can specify its font, size, bold, italic and color.
this.Add(new TextView { Text="Hello world" });
Like all other Zebble objects, the width of a TextView is determined by the general width rules, which means an even allocation of width among horizontal siblings. But if you want the TextView to take only the space needed by its actual text string and font, you can set AutoSizeWidth to true.
MarkUp:
Style.Border.Width="2" />
Stylesheet has a boolean property named Ignored, which is false by default. When set to true it works the same as "display: none" in HTML. It means that the element will not only be invisible, but also it won't occupy space on the screen.
View has a boolean property named Enabled, which is true by default. When set to false the object will not respond to UI gesture events. But it will remain visible. Also, its PseudoCssState will be set to "disabled" which allows you to specify a visual style for it in CSS.
MarkUp:
<TextView Id="MyText" Style.Height="20" Text="TextView 2" Enabled="false" />
<TextView Id="MyText" Style.Height="20" Text="TextView 3" />
<TextView Id="MyText" Style.Height="20" Text="TextView 4" Ignored="true"/>
<TextView Id="MyText" Style.Height="20" Text="TextView 5" />
PseudoCssState is a boolean value that if it will be set to "disabled", it allows you to specify a visual style for it in CSS.
MarkUp:
Style.TextColor="#AA00BB" Style.Font.Name="Arial"
Style.Font.Bold="true"/>
Zebble components have a special effect which is named BoxShadow. As you can see in next image, it has start X and Y position for effecting and the amount of radious.
MarkUp:
TextView has a method named ShouldWrap() which determines whether the text should be wrapped. By default, it will return true when the text size is larger than 20 characters. But you can override it by setting the Wrap property manually.
MarkUp:
You can set a text transform value to the style or css settings of a text view. When you do so, the original Text value will hold the original casing, but when rendered on the platform, the transformation will be applied. It works just like html.
The supported values are
TextTransform="None"/>
TextTransform="Uppercase"/>
In addition to all common CSS settings such as border, padding, margin, etc, the following css settings are supported specifically for text view and its descendants such as Button:
color: #553300;
text-transform: uppercase;
font-family: 'Arial';
font-weight: bold;
text-align: center;
vertical-align: top;
}
You can set the Css of text view object by following below: