Back

titanium alloy中动态获取某个 view element

发布时间: 2015-05-03 07:32:00

refer to:  http://developer.appcelerator.com/question/153890/alloy-controller-access-view-element-using-dynamic-id#264623

Alloy 的 view 中:h

<Window>
  <Label id='a' >lalala</Label>
</Window>

可以在controller中直接调用: 

$.a.text = 'bbb'

也可以:

$['a'].text='bbb'

在 tishadow 中,也可以的:

Alloy.createController('my_controller_name').__views.a

Back