class Header
package feathers.controls
extends FeathersControl › MeasureSprite › ValidatingSprite
implements ITextControl
A header that displays a title in the center, and optional views on the left and right.
In the following example, a header is created, given a title, and a back button:
var header = new Header();
header.text = "I'm a header";
var backButton = new Button();
backButton.text = "Back";
backButton.addEventListener(TriggerEvent.TRIGGER, (event) -> {
trace("back button triggered!");
});
header.leftView = backButton;
this.addChild(header);
1.0.0
.See also:
Constructor
Variables
backgroundSkin:DisplayObject
The default background skin to display behind the header's content.
The following example passes a bitmap for the header to use as a background skin:
header.backgroundSkin = new Bitmap(bitmapData);
1.0.0
.See also:
disabledBackgroundSkin:DisplayObject
A background skin to display behind the header's content when the header is disabled.
The following example gives the header a disabled background skin:
header.disabledBackgroundSkin = new Bitmap(bitmapData);
header.enabled = false;
1.0.0
.See also:
disabledTextFormat:AbstractTextFormat
The font styles used to render the header's text when the header is disabled.
In the following example, the header's disabled text formatting is customized:
header.enabled = false;
header.disabledTextFormat = new TextFormat("Helvetica", 20, 0xee0000);
1.0.0
.See also:
embedFonts:Bool
Determines if an embedded font is used or not.
In the following example, the header uses embedded fonts:
header.embedFonts = true;
1.0.0
.See also:
htmlText:String
Text displayed by the header that is parsed as a simple form of HTML.
The following example sets the header's HTML text:
header.htmlText = "<b>Hello</b> <i>World</i>";
1.0.0
.See also:
leftView:DisplayObject
The view to display on the left side of the header. To display multiple
views, create a LayoutGroup
and add the views as children.
1.0.0
.minGap:Float
The space between the header's title and its left and right views must
not be smaller than the value of the minGap
property.
The following example ensures that the gap is never smaller than 20 pixels:
header.minGap = 20.0;
1.0.0
.paddingBottom:Float
The minimum space, in pixels, between the header's bottom edge and the header's content.
In the following example, the header's bottom padding is set to 20 pixels:
header.paddingBottom = 20.0;
1.0.0
.paddingLeft:Float
The minimum space, in pixels, between the header's left edge and the header's content.
In the following example, the header's left padding is set to 20 pixels:
header.paddingLeft = 20.0;
1.0.0
.paddingRight:Float
The minimum space, in pixels, between the header's right edge and the header's content.
In the following example, the header's right padding is set to 20 pixels:
header.paddingRight = 20.0;
1.0.0
.paddingTop:Float
The minimum space, in pixels, between the header's top edge and the header's content.
In the following example, the header's top padding is set to 20 pixels:
header.paddingTop = 20.0;
1.0.0
.rightView:DisplayObject
The view to display on the right side of the header. To display multiple
views, create a LayoutGroup
and add the views as children.
1.0.0
.styleSheet:StyleSheet
A custom stylesheet to use with htmlText
.
If the styleSheet
style is not null
, the textFormat
style will
be ignored.
1.0.0
.See also:
text:String
The text displayed by the header.
The following example sets the header's text:
header.text = "Good afternoon!";
Note: If the htmlText
property is not null
, the text
property will
be ignored.
1.0.0
.See also:
textFormat:AbstractTextFormat
The font styles used to render the header's text.
In the following example, the header's text formatting is customized:
header.textFormat = new TextFormat("Helvetica", 20, 0xcc0000);
1.0.0
.See also:
verticalAlign:VerticalAlign
How the content is positioned vertically (along the y-axis) within the header.
The following example aligns the header's content to the top:
header.verticalAlign = TOP;
Note: The VerticalAlign.JUSTIFY
constant is not supported by this
component.
See also: