通过设置layoutDirection属性值为mx.core.LayoutDirection.RTL(右到左)或mx.core.LayoutDirection.LTR(左到右),使布局为靠左或靠右(如下图)。该属性可设置3种值,LayoutDirection.RTL、LayoutDirection.LTR和null(ILayoutDirectionElement时)/undefined(IStyleClient
时),null/undefined表示继承父类的该属性值。
以下是API中对mx.core.LayoutDirection类的叙述:
类
public
final class LayoutDirection
继承
LayoutDirection ->
Object
语言版本:
ActionScript 3.0
产品版本:
Flex 4.1
运行时版本:
Flash Player 10, AIR
2.0
LayoutDirection 类定义 IStyleClient 的
layoutDirection 样式和 ILayoutDirectionElement 的
layoutDirection 属性的常量值。对于拉丁样式脚本,通常采用从左到右的
layoutDirection。对于阿拉伯语或希伯来语等脚本,则采用从右到左的 layoutDirection。如果为
IStyleClient,将 layoutDirection 样式设置为 undefined 以从其祖代继承
layoutDirection。如果为 ILayoutDirectionElement,将 layoutDirection 属性设置为
null 以从其祖代继承 layoutDirection。
-----------------------------------------------------------------
对mx.core.ILayoutDirectionElement类的叙述:
接口
public
interface ILayoutDirectionElement
语言版本:
ActionScript 3.0
产品版本:
Flex 4.1
运行时版本:
Flash Player 10, AIR
1.5
ILayoutDirectionElement 接口定义对象支持
layoutDirection 属性时需要的最低限度属性和方法。
-----------------------------------------------------------------
对mx.styles.IStyleClient类的叙述:
该接口描述了对象要完全参与样式子系统所必须实现的属性和方法。该接口由 UIComponent
实现。
如果对象不需要在本地存储样式值,则该对象可改为实现
ISimpleStyleClient 接口。