【发布时间】:2014-02-18 10:36:21
【问题描述】:
我使用的是合金 1.3。 Controller.getView()中的内容可以更新吗?例如:
在 Alloy 中,如果我们有视图 view.xml
<Alloy>
<View>
<Label id="label1"/>
... other content ...
</View>
</Alloy>
在 view.js 中
exports.updateLabel = function(value){
$.label1.text = value;
}
如果我有另一个控制器,例如index.js
var v = Alloy.createController('view').getView();
// assume $.win is the <Window> in index.xml
$.win.add(v);
function updateContent(value){
// This is not work. I want to know how it can be updated
// after the controller turned into a view
v.updateLabel(value);
}
【问题讨论】:
标签: view controller titanium appcelerator titanium-alloy