【发布时间】:2015-10-26 03:00:26
【问题描述】:
TableView 显示在 iOS 模拟器中...但它没有显示在 android 物理设备中... 它们运行相同的代码并且没有发生错误。
var row = Titanium.UI.createTableViewRow({
width : Titanium.UI.FILL,
height : "20%",
left : 0,
backgroundColor : "orange",
separatorColor : "transparent",
fav_id:id,
});
var lblTitle = Ti.UI.createLabel({
top : "5%",
left : "0%",
height : Titanium.UI.SIZE,
width : "90%",
text : title,
textAlign : Ti.UI.TEXT_ALIGNMENT_LEFT,
color : "black",
//backgroundColor : 'blue',
maxLines: 2,
touchEnabled : false
});
var lblDate = Ti.UI.createLabel({
top : "50%",
left : "0%",
height : Titanium.UI.SIZE,
width : "90%",
text : date,
textAlign : Ti.UI.TEXT_ALIGNMENT_LEFT,
color : "black",
//backgroundColor : 'blue',
//maxLines:1,
touchEnabled : false
});
var lblCategory = Ti.UI.createLabel({
top : "50%",
left : "60%",
height : Titanium.UI.SIZE,
width : "90%",
text : category,
textAlign : Ti.UI.TEXT_ALIGNMENT_LEFT,
color : "black",
touchEnabled : false
//backgroundColor : 'white',
//maxLines:1,
});
row.add(lblTitle);
row.add(lblDate);
row.add(lblCategory);
dataTable.push(row);
$.tblFavourite.data = dataTable;
安卓系统怎么了?设计对tableview的输出有影响吗?
【问题讨论】:
-
我认为问题出在
height : "20%",。 -
@Swan 并且高度是行高,不是整个 tableview 的高度...
-
@jefferyleo 尝试设置 row.height = "50dp"
-
我认为在 tableView 行的情况下百分比不起作用。
-
@Surajkochale 天哪……你帮了我这个忙!谢谢,如何将您标记为正确答案?
标签: android ios titanium tableview appcelerator