class PageIndicator
package feathers.controls
extends FeathersControl › MeasureSprite › ValidatingSprite
implements IFocusObject, IIndexSelector
Displays a series of dots or other symbols, usually corresponding to a page
index in another UI control, such as PageNavigator
.
The following example creates a page indicator, sets its range and selected index, and lsitens for when the selection changes:
var pages = new PageIndicator();
pages.maxSelectedIndex = 5;
pages.selectedIndex = 1;
pages.addEventListener(Event.CHANGE, (event:Event) -> {
var pages = cast(event.currentTarget, PageIndicator);
trace("PageIndicator changed: " + pages.selectedIndex);
});
1.0.0
.See also:
Static variables
staticfinalread onlyCHILD_VARIANT_TOGGLE_BUTTON:String = "pageIndicator_toggleButton"
The variant used to style the toggle button child components in a theme.
1.0.0
.See also:
Constructor
Variables
backgroundSkin:DisplayObject
The default background skin to display behind the buttons.
The following example passes a bitmap for the page indicator to use as a background skin:
pages.backgroundSkin = new Bitmap(bitmapData);
1.0.0
.See also:
disabledBackgroundSkin:DisplayObject
A background skin to display behind the buttons when the page indicator is disabled.
The following example gives the page indicator a disabled background skin:
pages.disabledBackgroundSkin = new Bitmap(bitmapData);
pages.enabled = false;
1.0.0
.See also:
interactionMode:PageIndicatorInteractionMode
Determines how the selected index changes when the page indicator is clicked or tapped. If precise, the exact page must be chosen. If previous/next, the selection increases or decreases by one. Previous/next interaction is recommended on mobile, due to the low precision of touches.
In the following example, the interaction mode is changed to precise:
pages.interactionMode = PRECISE;
1.0.0
.layout:ILayout
The layout algorithm used to position and size the buttons.
By default, if no layout is provided by the time that the page indicator initializes, a default layout that displays items horizontally will be created.
The following example tells the page indicator to use a custom layout:
var layout = new HorizontalDistributedLayout();
layout.maxItemWidth = 300.0;
pages.layout = layout;
1.0.0
.toggleButtonRecycler:DisplayObjectRecycler<Dynamic, PageIndicatorItemState, ToggleButton> = DisplayObjectRecycler.withClass(ToggleButton)
Manages toggle buttons used by the page indicator.
In the following example, the page indicator uses a custom toggle button:
pages.toggleButtonRecycler = DisplayObjectRecycler.withClass(ToggleButtonSubClass);
1.0.0
.