钛 tableview 字体颜色
titanium tableview font color
如何更改 TableView 中的字体颜色。可以使用 color
属性更改其他元素。
当我 运行 我 Android Phone 上的应用程序显示 table,但字体颜色仍然是 grey/white。也没有 table 边框。我想将颜色设置为黑色。
// create an array of anonymous objects
var tbl_data = [
{title:'Row 1'},
{title:'Row 2'},
{title:'Row 3'}
];
// now assign that array to the table's data property to add those objects as rows
var table = Ti.UI.createTableView({
data:tbl_data,
color: '#000000'
});
amountView.add(table);
根据 Titanium 文档; TableView
没有 color
属性.
您可以做的是创建 TableViewRow
and add them to TableView
; and finally applying TableViewRow's
color
属性。 示例如下:
var tableData = [],
win = Ti.UI.createWindow();
tableData.push(Ti.UI.createTableViewRow({ title: 'Apples', color : "#000" }));
tableData.push(Ti.UI.createTableViewRow({ title: 'Bananas', color : "#000" }));
tableData.push(Ti.UI.createTableViewRow({ title: 'Carrots', color : "#000" }));
tableData.push(Ti.UI.createTableViewRow({ title: 'Potatoes', color : "#000" }));
var table = Ti.UI.createTableView({
data: tableData
});
win.add(table);
win.open();
如何更改 TableView 中的字体颜色。可以使用 color
属性更改其他元素。
当我 运行 我 Android Phone 上的应用程序显示 table,但字体颜色仍然是 grey/white。也没有 table 边框。我想将颜色设置为黑色。
// create an array of anonymous objects
var tbl_data = [
{title:'Row 1'},
{title:'Row 2'},
{title:'Row 3'}
];
// now assign that array to the table's data property to add those objects as rows
var table = Ti.UI.createTableView({
data:tbl_data,
color: '#000000'
});
amountView.add(table);
根据 Titanium 文档; TableView
没有 color
属性.
您可以做的是创建 TableViewRow
and add them to TableView
; and finally applying TableViewRow's
color
属性。 示例如下:
var tableData = [],
win = Ti.UI.createWindow();
tableData.push(Ti.UI.createTableViewRow({ title: 'Apples', color : "#000" }));
tableData.push(Ti.UI.createTableViewRow({ title: 'Bananas', color : "#000" }));
tableData.push(Ti.UI.createTableViewRow({ title: 'Carrots', color : "#000" }));
tableData.push(Ti.UI.createTableViewRow({ title: 'Potatoes', color : "#000" }));
var table = Ti.UI.createTableView({
data: tableData
});
win.add(table);
win.open();