【发布时间】:2017-07-31 07:59:47
【问题描述】:
我是 Titanium 的新手,面临合金中 Tableviewrow 高度的问题。我的要求是根据内容设置Tableviewrow的高度。我尝试了很多,但没有成功。我的 History.xml 代码是:
<Alloy>
<TableViewRow id="row" onClick="openHistoryDetail">
<View id="rowView" width="Ti.UI.FILL">
<View id="contentView">
<View id="leftView">
<ImageView id="leftImage" />
</View>
<View id="details" top="0">
<View width="100%" height="Titanium.UI.FILL" layout="horizontal">
<View width="65%" layout="vertical">
<Label id="topupCategory" class="mediumFont" text="" />
<Label id="phone" class="smallFont" text="" />
<Label id="date" class="smallFont" colocolor="#000" text="" />
</View>
<View width="35%" layout="vertical">
<Label id="transfered_amount" class="amtBalance" text="" />
<Label id="available_amount" class="mediumFont" text="" />
</View>
</View>
</View>
</View>
</View>
</TableViewRow>
.tss 文件包含:
"#row[platform=ios]": {
width : Titanium.UI.FILL,
height : Titanium.UI.FILL,
backgroundColor : "#ececec",
selectionStyle : Titanium.UI.iPhone.TableViewCellSelectionStyle.NONE}
"#row[platform=android]": {
width : Titanium.UI.FILL,
height : Titanium.UI.FILL,
backgroundColor : "#ececec"}
"#rowView":{
width : Titanium.UI.FILL,
height : Titanium.UI.FILL,
backgroundColor : "#ececec",
zIndex : 2,
borderWidth : 0.5,
borderColor : "#dadada"}
"#contentView":{
width : "100%",
height : Titanium.UI.SIZE,
backgroundColor : "#ececec"}
知道如何根据内容设置 Tableviewrow 的高度吗?提前致谢
【问题讨论】: