The HGroup container is an instance of the Group container
that uses the HorizontalLayout class.
Do not modify the layout property.
instead, use the properties of the HGroup class to modify the
characteristics of the HorizontalLayout class.
The HGroup container has the following default characteristics:
隱藏 MXML 語法
The <s:HGroup> tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:HGroup
Properties
columnWidth="no default"
gap="6"
horizontalAlign="left"
paddingBottom="0"
paddingLeft="0"
paddingRight="0"
paddingTop="0"
requestedColumnCount="-1"
requestedMaxColumnCount="-1"
requestedMinColumnCount="-1"
variableColumnWidth"true"
verticalAlign="top"
/>
mxmlContent
檢視範例
樣式可分為一般樣式及與特定主題關聯的樣式兩種。如果是一般樣式,可以與任何主題搭配使用。如果是與特定主題關聯的樣式,只有在您的應用程式使用特定主題時才能使用該樣式。
columnCount:int [唯讀]
Returns the current number of elements in view.
預設值為 -1。
此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 propertyChange 事件。
public function get columnCount():int
columnWidth:Number
If the variableColumnWidth property is false,
then this property specifies the actual width of each layout element, in pixels.
If the variableColumnWidth property is true,
the default, then this property has no effect.
The default value of this property is the preferred width
of the item specified by the typicalLayoutElement property.
public function get columnWidth():Number public function set columnWidth(value:Number):void
firstIndexInView:int [唯讀]
The index of the first column that is part of the layout and within
the layout target’s scroll rectangle, or -1 if nothing has been displayed yet.
Note that the column may only be partially in view.
此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 indexInViewChanged 事件。
public function get firstIndexInView():int
gap:int
The horizontal space between layout elements, in pixels.
Note that the gap is only applied between layout elements, so if there’s
just one element, the gap has no effect on the layout.
預設值為 6。
public function get gap():int public function set gap(value:int):void
horizontalAlign:String
The horizontal alignment of the content relative to the container’s width.
If the value is "left", "right", or "center" then the
layout element is aligned relative to the container’s contentWidth property.
This property has no effect when clipAndEnableScrolling is true
and the contentWidth is greater than the container’s width.
This property does not affect the layout’s measured size.
預設值為 "left"。
public function get horizontalAlign():String public function set horizontalAlign(value:String):void
lastIndexInView:int [唯讀]
The index of the last column that is part of the layout and within
the layout target’s scroll rectangle, or -1 if nothing has been displayed yet.
Note that the column may only be partially in view.
此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 indexInViewChanged 事件。
public function get lastIndexInView():int
paddingBottom:Number
The minimum number of pixels between the container’s bottom edge and
the bottom of all the container’s layout elements.
預設值為 0。
public function get paddingBottom():Number public function set paddingBottom(value:Number):void
paddingLeft:Number
Number of pixels between the container’s left edge
and the left edge of the first layout element.
預設值為 0。
public function get paddingLeft():Number public function set paddingLeft(value:Number):void
paddingRight:Number
Number of pixels between the container’s right edge
and the right edge of the last layout element.
預設值為 0。
public function get paddingRight():Number public function set paddingRight(value:Number):void
paddingTop:Number
The minimum number of pixels between the container’s top edge and
the top of all the container’s layout elements.
預設值為 0。
public function get paddingTop():Number public function set paddingTop(value:Number):void
requestedColumnCount:int
The measured size of this layout is wide enough to display
the first requestedColumnCount layout elements.
If requestedColumnCount is -1, then the measured
size will be big enough for all of the layout elements.
If the actual size of the container using this layout has been explicitly set,
then this property has no effect.
預設值為 -1。
public function get requestedColumnCount():int public function set requestedColumnCount(value:int):void
requestedMaxColumnCount:int
The measured width of this layout is large enough to display
at most requestedMaxColumnCount layout elements.
If requestedColumnCount is set, then
this property has no effect.
If the actual size of the container using this layout has been explicitly set,
then this property has no effect.
預設值為 -1。
public function get requestedMaxColumnCount():int public function set requestedMaxColumnCount(value:int):void
requestedMinColumnCount:int
The measured width of this layout is large enough to display
at least requestedMinColumnCount layout elements.
If requestedColumnCount is set, then
this property has no effect.
If the actual size of the container using this layout has been explicitly set,
then this property has no effect.
預設值為 -1。
public function get requestedMinColumnCount():int public function set requestedMinColumnCount(value:int):void
variableColumnWidth:Boolean
If true, specifies that layout elements are to be allocated their
preferred width.
Setting this property to false specifies fixed width columns.
The actual width of each layout element is
the value of the columnWidth property, and the layout ignores
a layout elements’ percentWidth property.
預設值為 true。
public function get variableColumnWidth():Boolean public function set variableColumnWidth(value:Boolean):void
verticalAlign:String
The vertical alignment of layout elements.
If the value is "bottom", "middle",
or "top" then the layout elements are aligned relative
to the container’s contentHeight property.
If the value is "contentJustify" then the actual
height of the layout element is set to
the container’s contentHeight property.
The content height of the container is the height of the largest layout element.
If all layout elements are smaller than the height of the container,
then set the height of all the layout elements to the height of the container.
If the value is "justify" then the actual height
of the layout elements is set to the container’s height.
If the value is "baseline" then the elements are positioned
such that their text is aligned to the maximum of the elements’ text ascent.
預設值為 "top"。
public function get verticalAlign():String public function set verticalAlign(value:String):void
public function HGroup()
Constructor.
Initializes the layout property to an instance of
the HorizontalLayout class.
<?xml version="1.0"?>
<!-- Simple example to demonstrate the Spark Group component. -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" >
<s:Panel title="HGroup Component Example"
width="75%" height="75%"
horizontalCenter="0" verticalCenter="0">
<s:Group left="10" right="10" top="10" bottom="10">
<s:HGroup gap="1">
<s:Button label="1" width="50" height="50" />
<s:Button label="2" width="50" height="50" />
<s:Button label="3" width="50" height="50" />
<s:Button label="4" width="50" height="50" />
</s:HGroup>
</s:Group>
</s:Panel>
</s:Application>
顯示 MXML 語法








