跳转到内容

类: Widget ​

更新: 2026/9/29 字数: 0 字 时长: 0 分钟

ui/view.Widget

  1. created
  2. render
  3. rootViewCreated: root view created but children are not inflated
  4. inflated: children inflated and internal and initial attributes are applied, but external attributes are not applied
  5. mounted: external attributes applied

目录 ​

Constructors ​

属性 ​

Accessors ​

方法 ​

Constructors ​

constructor ​

  • new Widget()

属性 ​

attrs ​

Accessors ​

initialAttributes ​

返回值

WidgetAttributes


view ​

  • get view(): any

返回值

any

方法 ​

created ​

  • created(): void

返回值

void


getAttribute ​

参数

名称类型
namestring
def() => AttributeValue

返回值

AttributeValue


hasAttribute ​

  • hasAttribute(name): boolean

参数

名称类型
namestring

返回值

boolean


inflated ​

  • inflated(): void

返回值

void


mounted ​

  • mounted(): void

返回值

void


render ​

  • Abstract render(context, parent): any

参数

名称类型
contextContext
parentViewGroup

返回值

any


rootViewCreated ​

  • rootViewCreated(view): void

参数

名称类型
viewany

返回值

void


setAttribute ​

  • setAttribute(name, value, def): void

参数

名称类型
namestring
valueAttributeValue
def(value: AttributeValue) => void

返回值

void


create ​

  • Static create(name): undefined | Widget

参数

名称类型
namestring

返回值

undefined | Widget


of ​

  • Static of<W>(view): undefined | W

类型参数

名称类型
Wextends Widget<W>

参数

名称类型
viewView

返回值

undefined | W


register ​

  • Static register(name, widget): void

参数

名称类型
namestring
widgetWidgetClass

返回值

void