BETA ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Hide Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes

Language Reference only
Filters: AIR 32.0 and earlier, Flash Player 32.0 and earlier, Flash Lite 4
None
Hide Filters
spark.layouts 

ViewMenuLayout  - AS3 Flex

(Preview)
Packagespark.layouts
Classpublic class ViewMenuLayout
InheritanceViewMenuLayout Inheritance LayoutBase Inheritance OnDemandEventDispatcher Inheritance Object

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: AIR 2.5

The ViewMenuLayout class defines the layout of the ViewMenu container. The menu can have multiple rows depending on the number of menu items.

The requestedMaxColumnCount property defines the maximum number of menu items in a row. By default, the property is set to three.

The ViewMenuLayout class define the layout as follows:

  • If you define three or fewer menu items, where the requestedMaxColumnCount property contains the default value of three, the menu items are displayed in a single row. Each menu item has the same size.

    If you define four or more menu items, meaning more menu items than specified by the requestedMaxColumnCount property, the ViewMenu container creates multiple rows.

  • If the number of menu items is evenly divisible by the requestedMaxColumnCount property, each row contains the same number of menu items. Each menu item is the same size.

    For example the requestedMaxColumnCount property is set to the default value of three and you define six menu items. The menu displays two rows, each containing three menu items.

  • If the number of menu items is not evenly divisible by the requestedMaxColumnCount property, rows can contain a different number of menu items. The size of the menu items depends on the number of menu items in the row.

    For example the requestedMaxColumnCount property is set to the default value of three and you define eight menu items. The menu displays three rows. The first row contains two menu items. The second and third rows each contains three items.

You can create your own custom layout for the menu by creating your own layout class. By default, the spark.skins.mobile.ViewMenuSkin class defines the skin for the ViewMenu container. To apply a customized ViewMenuLayout class to the ViewMenu container, define a new skin class for the ViewMenu container.

The ViewMenuSkin class includes a definition for a Group container named contentGroup, as shown below:

    <s:Group id="contentGroup" left="0" right="0" top="3" bottom="2" 
        minWidth="0" minHeight="0"> 
        <s:layout> 
            <s:ViewMenuLayout horizontalGap="2" verticalGap="2" id="contentGroupLayout" 
                requestedMaxColumnCount="3" requestedMaxColumnCount.landscapeGroup="6"/> 
        </s:layout> 
    </s:Group>

To apply your customized ViewMenuLayout class, your skin class should define a container named contentGroup. That container uses the layout property to specify your customized layout class.

MXML SyntaxexpandedHide MXML Syntax

The <s:ViewMenuLayout> tag inherits all of the tag attributes of its superclass and adds the following tag attributes:

  <s:ViewMenuLayout 
    Properties
    horizontalGap="2"
    requestedMaxColumnCount="3"
    verticalGap="2"
  />
  

More examples

Related API Elements



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
      horizontalGap : Number
The horizontal space between columns, in pixels.
ViewMenuLayout
      requestedMaxColumnCount : int
The maximum number of columns to display in a row.
ViewMenuLayout
      verticalGap : Number
The vertical space between rows, in pixels.
ViewMenuLayout
Public Methods
 MethodDefined By
  
    ViewMenuLayout()
Constructor.
ViewMenuLayout
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Protected Methods
 MethodDefined By
Property Detail
Constructor Detail