gpt4 book ai didi

android - TableView 未在 android titanium appcelerator 中显示

转载 作者:行者123 更新时间:2023-11-28 21:37:39 25 4
gpt4 key购买 nike

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 的输出吗?

最佳答案

我认为百分比在 tableViewRow 的情况下不起作用。尝试设置 row.height = "50dp"
希望这对您有所帮助。

关于android - TableView 未在 android titanium appcelerator 中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33337842/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com