【发布时间】:2014-09-25 12:13:27
【问题描述】:
大家好,我遇到了动态加载表格行的情况。设置表格行的代码如下:
var rows = [];
_.each(records, function(rec) {
var row = Alloy.createController('myRow', rec).getView();
rows.push(row);
});
}
$.myaTable.setData(rows);
我在每一行都有不同的价值。我想设置行高以适合文本。我试图设置行高
"TableViewRow": {
height: Ti.UI.SIZE
}
我还更改了 myRow.js,例如 $.myRow.height = Ti.UI.SIZE。
但问题是 - 它对所有行应用相同的高度。我在下面的图片中显示:
电流输出:
我的需要是:
编辑:
myRow.xml:
<TableViewRow id="ideaRow">
<View id="content">
<Label id="myTitle"></Label>
<Label id="myDesc"></Label>
<View id="control">
<View id="Control1" />
<View id="Control2" />
<View id="Control3" />
</View>
</View>
<TableViewRow>
myRow.js:
$. myTitle.text = args.title
$. myDesc.text = args.description
您认为 Titanium 中是否存在任何解决方案。在此先感谢
【问题讨论】:
-
在您的
myRow控制器内部。你是如何实例化行对象的? -
Josaih,我编辑了问题
标签: titanium titanium-mobile titanium-alloy