类: Widget
约 335 字大约 1 分钟
ui/view.Widget
- created
 - render
 - rootViewCreated: root view created but children are not inflated
 - inflated: children inflated and internal and initial attributes are applied, but external attributes are not applied
 - mounted: external attributes applied
 
目录
Constructors
属性
Accessors
方法
Constructors
constructor
• new Widget()
属性
attrs
• attrs: WidgetAttributes = {}
Accessors
initialAttributes
• get initialAttributes(): WidgetAttributes
返回值
view
• get view(): any
返回值
any
方法
created
▸ created(): void
返回值
void
getAttribute
▸ getAttribute(name, def): AttributeValue
参数
| 名称 | 类型 | 
|---|---|
name | string | 
def | () => AttributeValue | 
返回值
hasAttribute
▸ hasAttribute(name): boolean
参数
| 名称 | 类型 | 
|---|---|
name | string | 
返回值
boolean
inflated
▸ inflated(): void
返回值
void
mounted
▸ mounted(): void
返回值
void
render
▸ Abstract render(context, parent): any
参数
| 名称 | 类型 | 
|---|---|
context | Context | 
parent | ViewGroup | 
返回值
any
rootViewCreated
▸ rootViewCreated(view): void
参数
| 名称 | 类型 | 
|---|---|
view | any | 
返回值
void
setAttribute
▸ setAttribute(name, value, def): void
参数
| 名称 | 类型 | 
|---|---|
name | string | 
value | AttributeValue | 
def | (value: AttributeValue) => void | 
返回值
void
create
▸ Static create(name): undefined | Widget
参数
| 名称 | 类型 | 
|---|---|
name | string | 
返回值
undefined | Widget
of
▸ Static of<W>(view): undefined | W
类型参数
| 名称 | 类型 | 
|---|---|
W | extends Widget<W> | 
参数
| 名称 | 类型 | 
|---|---|
view | View | 
返回值
undefined | W
register
▸ Static register(name, widget): void
参数
| 名称 | 类型 | 
|---|---|
name | string | 
widget | WidgetClass | 
返回值
void
