| Package | xp.controls |
| Class | public class XPLabel |
| Inheritance | XPLabel mx.controls.Label |
| Subclasses | Separator |
The Text control does not support scroll bars. If you need scrolling, you should use a non-editable TextArea control.
You can format the text in a Text control using HTML tags, which are applied after the control's CSS styles are applied. You can also put padding around the four sides of the text.
The text in a Text control is selectable by default,
but you can make it unselectable by setting the selectable
property to false.
If the control is not as wide as the text, the text will wordwrap. The text is always aligned top-left in the control.
To size a Text component, it's common to specify an explicit width and let Flex determine the height as required to display all the text. If you specify an explicit height, some of the text may get clipped; unlike Label, Text does not truncate its text with "...". It's also common to use percentage widths and heights with Text.
If you leave both the width and the height unspecified,
Flex calculates them based on any explicit line breaks
in the text, with no wordwrapping within lines.
For example, if you set the text property,
the newline character "\n" causes a line break.
If you set the htmlText property, the HTML markup
<br> causes a line break.
If your text or htmlText is lengthy
and doesn't contain line breaks, you can get a very wide Text
component; you can set the maxWidth to limit
how wide the component is allowed to grow.
Text controls do not have backgrounds or borders and cannot take focus.
MXML Syntax
Hide MXML Syntax
The <mx:Text> tag inherits all of the tag attributes
of its superclass, and adds the following tag attributes:
<mx:Text leading="2" />
See also
| Property | Defined by | ||
|---|---|---|---|
| _paddingBottom : Number | XPLabel | ||
| _paddingLeft : Number | XPLabel | ||
| _paddingRight : Number | XPLabel | ||
| _paddingTop : Number | XPLabel | ||
| Method | Defined by | ||
|---|---|---|---|
|
XPLabel()
Constructor.
| XPLabel | ||
|
styleChanged(styleProp:String):void
| XPLabel | ||
| Method | Defined by | ||
|---|---|---|---|
|
drawLabel(unscaledWidth:Number, unscaledHeight:Number):void
| XPLabel | ||
| _paddingBottom | property |
protected var _paddingBottom:Number
| _paddingLeft | property |
protected var _paddingLeft:Number
| _paddingRight | property |
protected var _paddingRight:Number
| _paddingTop | property |
protected var _paddingTop:Number
| XPLabel | () | constructor |
public function XPLabel()Constructor.
| drawLabel | () | method |
protected function drawLabel(unscaledWidth:Number, unscaledHeight:Number):voidParameters
unscaledWidth:Number |
|
unscaledHeight:Number |
| styleChanged | () | method |
public override function styleChanged(styleProp:String):voidParameters
styleProp:String |