Flex-vgroup
フレックス-VGroup
前書き
VGroupコンテナは、VerticalLayoutクラスを使用するグループコンテナです。 VGroupクラスのプロパティを使用して、VerticalLayoutクラスの特性を変更します。
クラス宣言
以下は spark.components.VGroup クラスの宣言です-
public class VGroup
extends Group
パブリックプロパティ
Sr.No | Property & Description |
---|---|
1 |
firstIndexInView : int [read-only] The index of the first layout element that is part of the layout and within the layout target’s scroll rectangle, or -1 if nothing has been displayed yet. |
2 |
gap : int レイアウト要素間の垂直方向のスペース(ピクセル単位)。 |
3 |
horizontalAlign : String レイアウト要素の水平方向の配置。 |
4 |
lastIndexInView : int [read-only] The index of the last row that’s part of the layout and within the container’s scroll rectangle, or -1 if nothing has been displayed yet. |
5 |
paddingBottom : Number コンテナの下端と最後のレイアウト要素の下端の間のピクセル数。 |
6 |
paddingLeft : Number コンテナの左端とレイアウト要素の左端の間の最小ピクセル数。 |
7 |
paddingRight : Number コンテナの右端とレイアウト要素の右端の間の最小ピクセル数。 |
8 |
paddingTop : Number コンテナの上端と最初のレイアウト要素の上端の間のピクセル数。 |
9 |
requestedMaxRowCount : int このレイアウトの測定された高さは、最大でrequestedMaxRowCountレイアウト要素を表示するのに十分な大きさです。 |
10 |
requestedMinRowCount : int このレイアウトの測定された高さは、少なくともrequestedMinRowCountレイアウト要素を表示するのに十分な大きさです。 |
11 |
requestedRowCount : int このレイアウトの測定サイズは、最初のrequestedRowCountレイアウト要素を表示するのに十分な高さです。 |
12 |
rowCount : int [read-only] The current number of visible elements. |
13 |
rowHeight : Number variableRowHeightがfalseの場合、このプロパティは各子の実際の高さをピクセル単位で指定します。 |
14 |
variableRowHeight : Boolean レイアウト要素に優先高さを割り当てるかどうかを指定します。 |
15 |
verticalAlign : String コンテナの高さに対するコンテンツの垂直方向の配置。 |
パブリックメソッド
Sr.No | Method & Description |
---|---|
1 |
VGroup() コンストラクタ。 |
継承されるメソッド
このクラスは、次のクラスからメソッドを継承します-
- spark.components.Group
- spark.components.supportClasses.GroupBase
- mx.core.UIComponent
- mx.core.FlexSprite
- flash.display.Sprite
- flash.display.DisplayObjectContainer
- flash.display.InteractiveObject
- flash.display.DisplayObject
- flash.events.EventDispatcher
- 対象
Flex VGroupの例
テストアプリケーションを作成して、FlexアプリケーションでVGroupの使用状況を確認するには、次の手順に従います-
Step | Description |
---|---|
1 | Create a project with a name HelloWorld under a package com.finddevguides.client as explained in the Flex - Create Application chapter. |
2 | Modify HelloWorld.mxml as explained below. Keep rest of the files unchanged. |
3 | Compile and run the application to make sure business logic is working as per the requirements. |
以下は、変更されたmxmlファイル src/com.finddevguides/HelloWorld.mxml の内容です。
<?xml version = "1.0" encoding = "utf-8"?>
<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
width = "100%" height = "100%" minWidth = "500" minHeight = "500">
<fx:Style source = "/com/finddevguides/client/Style.css"/>
<fx:Script>
<![CDATA[
private function applyVGroupProperties():void {
mainVGroup.paddingTop = padTopV.value;
mainVGroup.paddingLeft = padLeftV.value;
mainVGroup.paddingRight = padRightV.value;
mainVGroup.paddingBottom = padBottomV.value;
mainVGroup.gap = gapV.value;
}
]]>
</fx:Script>
<s:BorderContainer width = "630" height = "480" id = "mainContainer"
styleName = "container">
<s:VGroup width = "100%" height = "100%" gap = "50"
horizontalAlign = "center" verticalAlign = "middle">
<s:Label id = "lblHeader" text = "Layout Panels Demonstration"
fontSize = "40" color = "0x777777" styleName = "heading"/>
<s:Panel id = "vGroupPanel" title = "Using VGroup"
width = "500" height = "300" includeInLayout = "true" visible = "true">
<s:layout>
<s:HorizontalLayout gap = "10" verticalAlign = "middle"
horizontalAlign = "center"/>
</s:layout>
<s:VGroup top = "10" left = "15">
<s:HGroup verticalAlign = "middle">
<s:Label text = "Gap:" width = "100"/>
<s:NumericStepper id = "gapV" maximum = "400"/>
</s:HGroup>
<s:HGroup verticalAlign = "middle">
<s:Label text = "Padding Top:" width = "100"/>
<s:NumericStepper id = "padTopV" maximum = "400"/>
</s:HGroup>
<s:HGroup verticalAlign = "middle">
<s:Label text = "Padding Left:" width = "100"/>
<s:NumericStepper id = "padLeftV" maximum = "400"/>
</s:HGroup>
<s:HGroup verticalAlign = "middle">
<s:Label text = "Padding Right:" width = "100"/>
<s:NumericStepper id = "padRightV" maximum = "400"/>
</s:HGroup>
<s:HGroup verticalAlign = "middle">
<s:Label text = "Padding Bottom:" width = "100"/>
<s:NumericStepper id = "padBottomV" maximum = "400"/>
</s:HGroup>
<s:Button label = "Apply Properties"
click = "applyVGroupProperties()"/>
</s:VGroup>
<s:VGroup left = "300" top = "25" id = "mainVGroup">
<s:BorderContainer width = "50" height = "50"
borderWeight = "2" color = "0x323232"/>
<s:BorderContainer width = "50" height = "50"
borderWeight = "2" color = "0x323232"/>
<s:BorderContainer width = "50" height = "50"
borderWeight = "2" color = "0x323232"/>
</s:VGroup>
</s:Panel>
</s:VGroup>
</s:BorderContainer>
</s:Application>
すべての変更が完了したら、link:/flex/flex_create_application [Flex-アプリケーションの作成]の章で行ったように、アプリケーションを通常モードでコンパイルして実行します。 アプリケーションに問題がない場合、次の結果が生成されます。[link:/flex/samples/LayoutsApplicationl#currentlyLoaded = VGroup [オンラインで試す]]