Class TextLabel

Definition

Namespace:
Tizen.NUI.BaseComponents
Assembly:
Tizen.NUI.dll
API Level:
3

A control which renders a short text string.
Text labels are lightweight, non-editable, and do not respond to the user input.

C#
Copy
public class TextLabel : View, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable, IResourcesProvider
Inheritance
Derived
Implements

Constructors

View Source

TextLabel()

Creates the TextLabel control.

Declaration
C#
Copy
public TextLabel()
API Level: 3
View Source

TextLabel(Boolean)

Creates the TextLabel with setting the status of shown or hidden.

Declaration
C#
Copy
public TextLabel(bool shown)
Parameters
Type Name Description
Boolean shown

false : Not displayed (hidden), true : displayed (shown)

View Source

TextLabel(String)

Creates the TextLabel control.

Declaration
C#
Copy
public TextLabel(string text)
Parameters
Type Name Description
String text

The text to display

API Level: 3
View Source

TextLabel(String, Boolean)

Creates the TextLabel with setting the status of shown or hidden.

Declaration
C#
Copy
public TextLabel(string text, bool shown)
Parameters
Type Name Description
String text

The text to display

Boolean shown

false : Not displayed (hidden), true : displayed (shown)

View Source

TextLabel(TextLabelStyle)

Declaration
C#
Copy
public TextLabel(TextLabelStyle viewStyle)
Parameters
Type Name Description
TextLabelStyle viewStyle

Fields

View Source

AutoScrollGapProperty

Declaration
C#
Copy
public static readonly BindableProperty AutoScrollGapProperty
Field Value
Type Description
BindableProperty
View Source

AutoScrollLoopCountProperty

Declaration
C#
Copy
public static readonly BindableProperty AutoScrollLoopCountProperty
Field Value
Type Description
BindableProperty
View Source

AutoScrollLoopDelayProperty

Declaration
C#
Copy
public static readonly BindableProperty AutoScrollLoopDelayProperty
Field Value
Type Description
BindableProperty
View Source

AutoScrollSpeedProperty

Declaration
C#
Copy
public static readonly BindableProperty AutoScrollSpeedProperty
Field Value
Type Description
BindableProperty
View Source

AutoScrollStopModeProperty

Declaration
C#
Copy
public static readonly BindableProperty AutoScrollStopModeProperty
Field Value
Type Description
BindableProperty
View Source

CharacterSpacingProperty

Declaration
C#
Copy
public static readonly BindableProperty CharacterSpacingProperty
Field Value
Type Description
BindableProperty
View Source

EllipsisPositionProperty

Declaration
C#
Copy
public static readonly BindableProperty EllipsisPositionProperty
Field Value
Type Description
BindableProperty
View Source

EllipsisProperty

Declaration
C#
Copy
public static readonly BindableProperty EllipsisProperty
Field Value
Type Description
BindableProperty
View Source

EmbossProperty

Declaration
C#
Copy
public static readonly BindableProperty EmbossProperty
Field Value
Type Description
BindableProperty
View Source

EnableAutoScrollProperty

Declaration
C#
Copy
public static readonly BindableProperty EnableAutoScrollProperty
Field Value
Type Description
BindableProperty
View Source

EnableFontSizeScaleProperty

Declaration
C#
Copy
public static readonly BindableProperty EnableFontSizeScaleProperty
Field Value
Type Description
BindableProperty
View Source

EnableMarkupProperty

Declaration
C#
Copy
public static readonly BindableProperty EnableMarkupProperty
Field Value
Type Description
BindableProperty
View Source

FontFamilyProperty

Declaration
C#
Copy
public static readonly BindableProperty FontFamilyProperty
Field Value
Type Description
BindableProperty
View Source

FontSizeScaleProperty

Declaration
C#
Copy
public static readonly BindableProperty FontSizeScaleProperty
Field Value
Type Description
BindableProperty
View Source

FontStyleProperty

Declaration
C#
Copy
public static readonly BindableProperty FontStyleProperty
Field Value
Type Description
BindableProperty
View Source

HorizontalAlignmentProperty

Declaration
C#
Copy
public static readonly BindableProperty HorizontalAlignmentProperty
Field Value
Type Description
BindableProperty
View Source

LineSpacingProperty

Declaration
C#
Copy
public static readonly BindableProperty LineSpacingProperty
Field Value
Type Description
BindableProperty
View Source

LineWrapModeProperty

Declaration
C#
Copy
public static readonly BindableProperty LineWrapModeProperty
Field Value
Type Description
BindableProperty
View Source

MatchSystemLanguageDirectionProperty

Declaration
C#
Copy
public static readonly BindableProperty MatchSystemLanguageDirectionProperty
Field Value
Type Description
BindableProperty
View Source

MinLineSizeProperty

Declaration
C#
Copy
public static readonly BindableProperty MinLineSizeProperty
Field Value
Type Description
BindableProperty
View Source

MultiLineProperty

Declaration
C#
Copy
public static readonly BindableProperty MultiLineProperty
Field Value
Type Description
BindableProperty
View Source

OutlineProperty

Declaration
C#
Copy
public static readonly BindableProperty OutlineProperty
Field Value
Type Description
BindableProperty
View Source

PixelSizeProperty

Declaration
C#
Copy
public static readonly BindableProperty PixelSizeProperty
Field Value
Type Description
BindableProperty
View Source

PointSizeProperty

Declaration
C#
Copy
public static readonly BindableProperty PointSizeProperty
Field Value
Type Description
BindableProperty
View Source

RelativeLineHeightProperty

Declaration
C#
Copy
public static readonly BindableProperty RelativeLineHeightProperty
Field Value
Type Description
BindableProperty
View Source

ShadowColorProperty

ShadowColorProperty

Declaration
C#
Copy
public static readonly BindableProperty ShadowColorProperty
Field Value
Type Description
BindableProperty
View Source

ShadowOffsetProperty

ShadowOffsetProperty

Declaration
C#
Copy
public static readonly BindableProperty ShadowOffsetProperty
Field Value
Type Description
BindableProperty
View Source

ShadowProperty

Declaration
C#
Copy
public static readonly BindableProperty ShadowProperty
Field Value
Type Description
BindableProperty
View Source

TextColorProperty

Declaration
C#
Copy
public static readonly BindableProperty TextColorProperty
Field Value
Type Description
BindableProperty
View Source

TextFitProperty

Declaration
C#
Copy
public static readonly BindableProperty TextFitProperty
Field Value
Type Description
BindableProperty
View Source

TextProperty

Declaration
C#
Copy
public static readonly BindableProperty TextProperty
Field Value
Type Description
BindableProperty
View Source

TextShadowProperty

Declaration
C#
Copy
public static readonly BindableProperty TextShadowProperty
Field Value
Type Description
BindableProperty
View Source

TranslatableTextProperty

StyleNameProperty

Declaration
C#
Copy
public static readonly BindableProperty TranslatableTextProperty
Field Value
Type Description
BindableProperty
View Source

UnderlineColorProperty

UnderlineColorProperty

Declaration
C#
Copy
public static readonly BindableProperty UnderlineColorProperty
Field Value
Type Description
BindableProperty
View Source

UnderlineEnabledProperty

UnderlineEnabledProperty

Declaration
C#
Copy
public static readonly BindableProperty UnderlineEnabledProperty
Field Value
Type Description
BindableProperty
View Source

UnderlineHeightProperty

UnderlineHeightProperty

Declaration
C#
Copy
public static readonly BindableProperty UnderlineHeightProperty
Field Value
Type Description
BindableProperty
View Source

UnderlineProperty

Declaration
C#
Copy
public static readonly BindableProperty UnderlineProperty
Field Value
Type Description
BindableProperty
View Source

VerticalAlignmentProperty

Declaration
C#
Copy
public static readonly BindableProperty VerticalAlignmentProperty
Field Value
Type Description
BindableProperty
View Source

VerticalLineAlignmentProperty

Declaration
C#
Copy
public static readonly BindableProperty VerticalLineAlignmentProperty
Field Value
Type Description
BindableProperty

Properties

View Source

AutoScrollGap

The AutoScrollGap property.
Gap before scrolling wraps.

Declaration
C#
Copy
public float AutoScrollGap { get; set; }
Property Value
Type Description
Single
API Level: 3
View Source

AutoScrollLoopCount

The AutoScrollLoopCount property.
Number of complete loops when scrolling enabled.

Declaration
C#
Copy
public int AutoScrollLoopCount { get; set; }
Property Value
Type Description
Int32
API Level: 3
View Source

AutoScrollLoopDelay

The AutoScrollLoopDelay property.
The amount of time to delay the starting time of auto scrolling and further loops.

Declaration
C#
Copy
public float AutoScrollLoopDelay { get; set; }
Property Value
Type Description
Single
API Level: 3
View Source

AutoScrollSpeed

The AutoScrollSpeed property.
Sets the speed of scrolling in pixels per second.

Declaration
C#
Copy
public int AutoScrollSpeed { get; set; }
Property Value
Type Description
Int32
API Level: 3
View Source

AutoScrollStopMode

The AutoScrollStopMode property.
The auto scrolling stop behaviour.
The default value is AutoScrollStopMode.FinishLoop.

Declaration
C#
Copy
public AutoScrollStopMode AutoScrollStopMode { get; set; }
Property Value
Type Description
AutoScrollStopMode
API Level: 3
View Source

CharacterSpacing

The spaces between characters in Pixels. A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed).
The default value is 0.f which does nothing.

Declaration
C#
Copy
public float CharacterSpacing { get; set; }
Property Value
Type Description
Single
View Source

Ellipsis

The Ellipsis property.
Enable or disable the ellipsis.

Declaration
C#
Copy
public bool Ellipsis { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

EllipsisPosition

The ellipsis position of the text. Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.

Declaration
C#
Copy
public EllipsisPosition EllipsisPosition { get; set; }
Property Value
Type Description
EllipsisPosition
API Level: 9
View Source

Emboss

The Emboss property.
The default emboss parameters.

Declaration
C#
Copy
public string Emboss { get; set; }
Property Value
Type Description
String
API Level: 3
View Source

EnableAutoScroll

The EnableAutoScroll property.
Starts or stops auto scrolling.

Declaration
C#
Copy
public bool EnableAutoScroll { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

EnableFontSizeScale

The EnableFontSizeScale property.
Whether the font size scale is enabled. (The default value is true)

Declaration
C#
Copy
public bool EnableFontSizeScale { get; set; }
Property Value
Type Description
Boolean
View Source

EnableMarkup

The EnableMarkup property.
Whether the mark-up processing is enabled.

Declaration
C#
Copy
public bool EnableMarkup { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

FontFamily

The FontFamily property.
The requested font family to use.

Declaration
C#
Copy
public string FontFamily { get; set; }
Property Value
Type Description
String
API Level: 3
View Source

FontSizeScale

The FontSizeScale property for scaling the specified font size up or down.
The default value is 1.0.
The given font size scale value is used for multiplying the specified font size before querying fonts.
If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally.

Declaration
C#
Copy
public float FontSizeScale { get; set; }
Property Value
Type Description
Single
API Level: 9
View Source

FontStyle

The FontStyle property.
The requested font style to use.
The fontStyle map contains the following keys :

width (string)The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded)
weight (string)The weight key defines the thickness or darkness of the glyphs. (values: thin, ultraLight, extraLight, light, demiLight, semiLight, book, normal, regular, medium, demiBold, semiBold, bold, ultraBold, extraBold, black, heavy, extraBlack)
slant (string)The slant key defines whether to use italics. (values: normal, roman, italic, oblique)

Declaration
C#
Copy
public PropertyMap FontStyle { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

HorizontalAlignment

The HorizontalAlignment property.
The line horizontal alignment.

Declaration
C#
Copy
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
Type Description
HorizontalAlignment
API Level: 3
View Source

LineCount

The line count of the text.

Declaration
C#
Copy
public int LineCount { get; }
Property Value
Type Description
Int32
API Level: 3
View Source

LineSpacing

The LineSpacing property.
The default extra space between lines in points.

Declaration
C#
Copy
public float LineSpacing { get; set; }
Property Value
Type Description
Single
API Level: 3
View Source

LineWrapMode

The LineWrapMode property.
line wrap mode when the text lines over layout width.

Declaration
C#
Copy
public LineWrapMode LineWrapMode { get; set; }
Property Value
Type Description
LineWrapMode
API Level: 4
View Source

MatchSystemLanguageDirection

The text alignment to match the direction of the system language.

Declaration
C#
Copy
public bool MatchSystemLanguageDirection { get; set; }
Property Value
Type Description
Boolean
API Level: 6
View Source

MinLineSize

The MinLineSize property.
The height of the line in points.
If the font size is larger than the line size, it works with the font size.

Declaration
C#
Copy
public float MinLineSize { get; set; }
Property Value
Type Description
Single
View Source

MultiLine

The MultiLine property.
The single-line or multi-line layout option.

Declaration
C#
Copy
public bool MultiLine { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

Outline

The Outline property.
The default outline parameters.
The outline map contains the following keys :

color (Color)The color of the outline (the default color is Color.White)
width (float)The width in pixels of the outline (If not provided then the outline is not enabled)

Declaration
C#
Copy
public PropertyMap Outline { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

PixelSize

The PixelSize property.
The size of font in pixels.

Declaration
C#
Copy
public float PixelSize { get; set; }
Property Value
Type Description
Single
API Level: 3
View Source

PointSize

The PointSize property.
The size of font in points.

Declaration
C#
Copy
public float PointSize { get; set; }
Property Value
Type Description
Single
API Level: 3
View Source

RelativeLineHeight

The relative height of the line (a factor that will be multiplied by text height).
If the value is less than 1, the lines could to be overlapped.

Declaration
C#
Copy
public float RelativeLineHeight { get; set; }
Property Value
Type Description
Single
View Source

Shadow

The Shadow property.
The default shadow parameters.
The shadow map contains the following keys :

color (Color)The color of the shadow (the default color is Color.Black)
offset (Vector2)The offset in pixels of the shadow (If not provided then the shadow is not enabled)
blurRadius (float)The radius of the Gaussian blur for the soft shadow (If not provided then the soft shadow is not enabled)

Declaration
C#
Copy
public PropertyMap Shadow { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

ShadowColor

The ShadowColor property.
The color of a drop shadow.

Declaration
C#
Copy
public Vector4 ShadowColor { get; set; }
Property Value
Type Description
Vector4
Remarks

Deprecated.(API Level 6) Use Shadow instead. The property cascade chaining set is possible. For example, this (textLabel.ShadowColor.X = 0.1f;) is possible.

API Level: 3
View Source

ShadowOffset

The ShadowOffset property.
The drop shadow offset 0 indicates no shadow.

Declaration
C#
Copy
public Vector2 ShadowOffset { get; set; }
Property Value
Type Description
Vector2
Remarks

Deprecated.(API Level 6) Use Shadow instead. The property cascade chaining set is possible. For example, this (textLabel.ShadowOffset.X = 0.1f;) is possible.

API Level: 3
View Source

Text

The Text property.
The text to display in the UTF-8 format.

Declaration
C#
Copy
public string Text { get; set; }
Property Value
Type Description
String
API Level: 3
View Source

TextColor

The TextColor property.
The color of the text.
Animation framework can be used to change the color of the text when not using mark up.
Cannot animate the color when text is auto scrolling.

Declaration
C#
Copy
public Color TextColor { get; set; }
Property Value
Type Description
Color
Remarks

The property cascade chaining set is possible. For example, this (textLabel.TextColor.X = 0.1f;) is possible.

API Level: 3
View Source

TextDirection

The direction of the text such as left to right or right to left.

Declaration
C#
Copy
public TextDirection TextDirection { get; }
Property Value
Type Description
TextDirection
View Source

TextFit

The text fit parameters.
The textFit map contains the following keys :

enable (bool)True to enable the text fit or false to disable (the default value is false)
minSize (float)Minimum Size for text fit (the default value is 10.f)
maxSize (float)Maximum Size for text fit (the default value is 100.f)
stepSize (float)Step Size for font increase (the default value is 1.f)
fontSize (string)The size type of font, You can choose between "pointSize" or "pixelSize". (the default value is "pointSize")

Declaration
C#
Copy
public PropertyMap TextFit { get; set; }
Property Value
Type Description
PropertyMap
View Source

TextShadow

Describes a text shadow for a TextLabel. It is null by default.

Declaration
C#
Copy
public TextShadow TextShadow { get; set; }
Property Value
Type Description
TextShadow
View Source

TranslatableText

The TranslatableText property.
The text can set the SID value.

Declaration
C#
Copy
public string TranslatableText { get; set; }
Property Value
Type Description
String
API Level: 4
View Source

Underline

The Underline property.
The default underline parameters.
The underline map contains the following keys :

enable (bool)Whether the underline is enabled (the default value is false)
color (Color)The color of the underline (If not provided then the color of the text is used)
height (float)The height in pixels of the underline (the default value is 1.f)

Declaration
C#
Copy
public PropertyMap Underline { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

UnderlineColor

The UnderlineColor property.
Overrides the underline height from font metrics.

Declaration
C#
Copy
public Vector4 UnderlineColor { get; set; }
Property Value
Type Description
Vector4
Remarks

Deprecated.(API Level 6) Use Underline instead. The property cascade chaining set is possible. For example, this (textLabel.UnderlineColor.X = 0.1f;) is possible.

API Level: 3
View Source

UnderlineEnabled

The UnderlineEnabled property.
The underline enabled flag.

Declaration
C#
Copy
public bool UnderlineEnabled { get; set; }
Property Value
Type Description
Boolean
Remarks

Deprecated.(API Level 6) Use Underline instead.

API Level: 3
View Source

UnderlineHeight

The UnderlineHeight property.
Overrides the underline height from font metrics.

Declaration
C#
Copy
public float UnderlineHeight { get; set; }
Property Value
Type Description
Single
Remarks

Deprecated.(API Level 6) Use Underline instead.

API Level: 3
View Source

VerticalAlignment

The VerticalAlignment property.
The line vertical alignment.

Declaration
C#
Copy
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
Type Description
VerticalAlignment
API Level: 3
View Source

VerticalLineAlignment

The vertical line alignment of the text.

Declaration
C#
Copy
public VerticalLineAlignment VerticalLineAlignment { get; set; }
Property Value
Type Description
VerticalLineAlignment

Methods

View Source

CreateViewStyle()

Get attribues, it is abstract function and must be override.

Declaration
C#
Copy
protected override ViewStyle CreateViewStyle()
Returns
Type Description
ViewStyle
Overrides
View Source

Dispose(DisposeTypes)

you can override it to clean-up your own resources.

Declaration
C#
Copy
protected override void Dispose(DisposeTypes type)
Parameters
Type Name Description
DisposeTypes type

DisposeTypes

Overrides
View Source

DownCast(BaseHandle)

Downcasts a handle to textLabel handle

Declaration
C#
Copy
public static TextLabel DownCast(BaseHandle handle)
Parameters
Type Name Description
BaseHandle handle
Returns
Type Description
TextLabel
API Level: 3
View Source

GetFontStyle()

Get FontStyle from TextLabel.

Declaration
C#
Copy
public FontStyle GetFontStyle()
Returns
Type Description
FontStyle

The FontStyle

Remarks
View Source

GetOutline()

Get Outline from TextLabel.

Declaration
C#
Copy
public Outline GetOutline()
Returns
Type Description
Outline

The Outline

Remarks
View Source

GetShadow()

Get Shadow from TextLabel.

Declaration
C#
Copy
public Shadow GetShadow()
Returns
Type Description
Shadow

The Shadow

Remarks
View Source

GetStrikethrough()

Get Strikethrough from TextLabel.

Declaration
C#
Copy
public Strikethrough GetStrikethrough()
Returns
Type Description
Strikethrough

The Strikethrough

Remarks
View Source

GetTextFit()

Get TextFit from TextLabel.

Declaration
C#
Copy
public TextFit GetTextFit()
Returns
Type Description
TextFit

The TextFit

Remarks

TextFit is always returned based on PointSize.
If the user sets FontSizeType to PixelSize, then MinSize, MaxSize, and StepSize are converted based on PointSize and returned.
TextFit

View Source

GetTextFitArray()

Get TextFitArray from TextLabel.

Declaration
C#
Copy
public TextFitArray GetTextFitArray()
Returns
Type Description
TextFitArray

The TextFitArray

Remarks
Examples

The following example demonstrates how to use the GetTextFitArray method.

Copy
Tizen.NUI.Text.TextFitArray textFitArray = label.GetTextFitArray(); bool enable = textFitArray.Enable; var optionList = textFitArray.OptionList; foreach(Tizen.NUI.Text.TextFitArrayOption option in optionList) { float pointSize = option.PointSize; float minLinesize = option.MinLineSize; }
View Source

GetUnderline()

Get Underline from TextLabel.

Declaration
C#
Copy
public Underline GetUnderline()
Returns
Type Description
Underline

The Underline

Remarks
View Source

OnBindingContextChanged()

Invoked whenever the binding context of the textlabel changes. Implement this method to add class handling for this event.

Declaration
C#
Copy
protected override void OnBindingContextChanged()
Overrides
View Source

ReleaseSwigCPtr(Runtime.InteropServices.HandleRef)

Declaration
C#
Copy
protected override void ReleaseSwigCPtr(Runtime.InteropServices.HandleRef swigCPtr)
Parameters
Type Name Description
Tizen.System.Runtime.InteropServices.HandleRef swigCPtr
Overrides
View Source

SetFontStyle(FontStyle)

Set FontStyle to TextLabel.

Declaration
C#
Copy
public void SetFontStyle(FontStyle fontStyle)
Parameters
Type Name Description
FontStyle fontStyle

The FontStyle

Remarks

SetFontStyle specifies the requested font style through FontStyle.

Examples

The following example demonstrates how to use the SetFontStyle method.

Copy
var fontStyle = new Tizen.NUI.Text.FontStyle(); fontStyle.Width = FontWidthType.Expanded; fontStyle.Weight = FontWeightType.Bold; fontStyle.Slant = FontSlantType.Italic; label.SetFontStyle(fontStyle);
View Source

SetOutline(Outline)

Set Outline to TextLabel.

Declaration
C#
Copy
public void SetOutline(Outline outline)
Parameters
Type Name Description
Outline outline

The Outline

Remarks

SetOutline specifies the outline of the text through Outline.

Examples

The following example demonstrates how to use the SetOutline method.

Copy
var outline = new Tizen.NUI.Text.Outline(); outline.Width = 2.0f; outline.Color = new Color("#45B39D"); label.SetOutline(outline);
View Source

SetShadow(Shadow)

Set Shadow to TextLabel.

Declaration
C#
Copy
public void SetShadow(Shadow shadow)
Parameters
Type Name Description
Shadow shadow

The Shadow

Remarks

SetShadow specifies the shadow of the text through Shadow.

Examples

The following example demonstrates how to use the SetShadow method.

Copy
var shadow = new Tizen.NUI.Text.Shadow(); shadow.Offset = new Vector2(3, 3); shadow.Color = new Color("#F1C40F"); shadow.BlurRadius = 4.0f; label.SetShadow(shadow);
View Source

SetStrikethrough(Strikethrough)

Set Strikethrough to TextLabel.

Declaration
C#
Copy
public void SetStrikethrough(Strikethrough strikethrough)
Parameters
Type Name Description
Strikethrough strikethrough

The Strikethrough

Remarks

SetStrikethrough specifies the strikethrough of the text through Strikethrough.

Examples

The following example demonstrates how to use the SetStrikethrough method.

Copy
var strikethrough = new Tizen.NUI.Text.Strikethrough(); strikethrough.Enable = true; strikethrough.Color = new Color("#3498DB"); strikethrough.Height = 2.0f; label.SetStrikethrough(strikethrough);
View Source

SetTextFit(TextFit)

Set TextFit to TextLabel.

Declaration
C#
Copy
public void SetTextFit(TextFit textFit)
Parameters
Type Name Description
TextFit textFit

The TextFit

Remarks

SetTextFit specifies the textFit of the text through TextFit.

Examples

The following example demonstrates how to use the SetTextFit method.

Copy
var textFit = new Tizen.NUI.Text.TextFit(); textFit.Enable = true; textFit.MinSize = 10.0f; textFit.MaxSize = 100.0f; textFit.StepSize = 5.0f; textFit.FontSizeType = FontSizeType.PointSize; label.SetTextFit(textFit);
View Source

SetTextFitArray(TextFitArray)

Set TextFitArray to TextLabel.
TextFitArray finds and applies the largest PointSize that fits among OptionList.

Declaration
C#
Copy
public void SetTextFitArray(TextFitArray textFitArray)
Parameters
Type Name Description
TextFitArray textFitArray

The TextFitArray

Remarks

TextFitArray tries binary search by default.
The precondition for TextFitArray to perform binary search is sorting in ascending order of MinLineSize.
Because if MinLineSize is not sorted in ascending order,
binary search cannot guarantee that it will always find the best value.
In this case, the search sequentially starts from the largest PointSize.
If TextFitArrayOption's MinLineSize is set to null or 0,
TextFitArray is calculated without applying MinLineSize.
If TextFitArray is enabled, TextLabel's MinLineSize property is ignored.
See TextFitArray and TextFitArrayOption.

Examples

The following example demonstrates how to use the SetTextFitArray method.

Copy
var textFitArray = new Tizen.NUI.Text.TextFitArray(); textFitArray.Enable = true; textFitArray.OptionList = new List<Tizen.NUI.Text.TextFitArrayOption>() { new Tizen.NUI.Text.TextFitArrayOption(12, 18), new Tizen.NUI.Text.TextFitArrayOption(24, 40), new Tizen.NUI.Text.TextFitArrayOption(28, 48), new Tizen.NUI.Text.TextFitArrayOption(32, 56), new Tizen.NUI.Text.TextFitArrayOption(50, 72), }; label.SetTextFitArray(textFitArray);


The table below shows cases where binary search is possible and where it is not possible.

Copy
[Binary search possible] | | List index | 0 | 1 | 2 | 3 | | OptionList | PointSize | 24 | 28 | 32 | 48 | | | MinLineSize | 40 | 48 | 48 | 62 | << MinLineSize sorted in ascending order ^ ^ same values ​are not a problem [Binary search not possible] | | List index | 0 | 1 | 2 | 3 | | OptionList | PointSize | 24 | 28 | 32 | 48 | | | MinLineSize | 40 | 48 | 38 | 62 | << MinLineSize is not sorted in ascending order ^
View Source

SetUnderline(Underline)

Set Underline to TextLabel.

Declaration
C#
Copy
public void SetUnderline(Underline underline)
Parameters
Type Name Description
Underline underline

The Underline

Remarks

SetUnderline specifies the underline of the text through Underline.

Examples

The following example demonstrates how to use the SetUnderline method.

Copy
var underline = new Tizen.NUI.Text.Underline(); underline.Enable = true; underline.Color = new Color("#3498DB"); underline.Height = 2.0f; label.SetUnderline(underline);

Events

View Source

AnchorClicked

The AnchorClicked signal is emitted when the anchor is clicked.

Declaration
C#
Copy
public event EventHandler<AnchorClickedEventArgs> AnchorClicked
Event Type
Type Description
EventHandler<AnchorClickedEventArgs>
API Level: 9
View Source

TextFitChanged

An event for the TextFitChanged signal which can be used to subscribe or unsubscribe the event handler provided by the user. The TextFitChanged signal is emitted when the text fit properties changes.

Declaration
C#
Copy
public event EventHandler TextFitChanged
Event Type
Type Description
EventHandler

Implements

Extension Methods