继承 Button
View
模块 hilo/view/Button
依赖
hilo/core/Hilo, hilo/core/Class, hilo/view/View, hilo/view/Drawable, hilo/util/util
源码
Button.js
Button类表示简单按钮类。它有弹起、经过、按下和不可用等四种状态。
示例:
var btn = new Hilo.Button({
image: buttonImage,
upState: {rect:[0, 0, 64, 64]},
overState: {rect:[64, 0, 64, 64]},
downState: {rect:[128, 0, 64, 64]},
disabledState: {rect:[192, 0, 64, 64]}
});
| 属性 | 定义于 | |
|---|---|---|
|
disabledState:Object
按钮不可用状态的属性或其drawable的属性的集合。
|
Button | |
|
downState:Object
按钮按下状态的属性或其drawable的属性的集合。
|
Button | |
|
enabled:Boolean
指示按钮是否可用。默认为true。只读属性。
|
Button | |
|
overState:Object
按钮经过状态的属性或其drawable的属性的集合。
|
Button | |
|
state:String
按钮的状态名称。它是 Button.UP|OVER|DOWN|DISABLED 之一。 只读属性。
|
Button | |
|
upState:Object
按钮弹起状态的属性或其drawable的属性的集合。
|
Button | |
|
useHandCursor:Boolean
当设置为true时,表示指针滑过按钮上方时是否显示手形光标。默认为true。
|
Button | |
|
OVER:String
static
按钮经过状态的常量值,即:'over'。
|
Button | |
|
DOWN:String
static
按钮按下状态的常量值,即:'down'。
|
Button | |
|
DISABLED:String
static
按钮不可用状态的常量值,即:'disabled'。
|
Button | |
|
UP:String
static
按钮弹起状态的常量值,即:'up'。
|
Button |
| 方法 | 定义于 | |
|---|---|---|
|
Button(properties:Object)
构造函数
|
Button | |
|
setEnabled(enabled:Boolean):Button
设置按钮是否可用。
|
Button | |
|
setState(state:String):Button
设置按钮的状态。此方法由Button内部调用,一般无需使用此方法。
|
Button |