继承 Container
View
模块 hilo/view/Container
依赖
hilo/core/Hilo, hilo/core/Class, hilo/view/View
源码
Container.js
Container是所有容器类的基类。每个Container都可以添加其他可视对象为子级。
| 属性 | 定义于 | |
|---|---|---|
|
children:Array
容器的子元素列表。只读。
|
Container | |
|
clipChildren:Boolean
指示是否裁剪超出容器范围的子元素。默认为false。
|
Container | |
|
pointerChildren:Boolean
指示容器的子元素是否能响应用户交互事件。默认为true。
|
Container |
| 方法 | 定义于 | |
|---|---|---|
|
Container(properties:Object)
构造函数
|
Container | |
|
在最上面添加子元素。
|
Container | |
|
addChildAt(child:View, index:Number)
在指定索引位置添加子元素。
|
Container | |
|
返回是否包含参数指定的子元素。
|
Container | |
|
getChildAt(index:Number)
返回指定索引位置的子元素。
|
Container | |
|
getChildById(id:String)
返回指定id的子元素。
|
Container | |
|
getChildIndex(child:View)
返回指定子元素的索引值。
|
Container | |
|
getNumChildren():Uint
返回容器的子元素的数量。
|
Container | |
|
getViewAtPoint(x:Number, y:Number, usePolyCollision:Boolean, global:Boolean, eventMode:Boolean)
返回由x和y指定的点下的对象。
|
Container | |
|
removeAllChildren():Container
删除所有的子元素。
|
Container | |
|
removeChild(child:View):View
删除指定的子元素。
|
Container | |
|
removeChildAt(index:Int):View
在指定索引位置删除子元素。
|
Container | |
|
removeChildById(id:String):View
删除指定id的子元素。
|
Container | |
|
setChildIndex(child:View, index:Number)
设置子元素的索引位置。
|
Container | |
|
sortChildren(keyOrFunction:Object)
根据指定键值或函数对子元素进行排序。
|
Container | |
|
交换两个子元素的索引位置。
|
Container | |
|
swapChildrenAt(index1:Number, index2:Number)
交换两个指定索引位置的子元素。
|
Container |