【发布时间】:2012-04-20 14:18:09
【问题描述】:
我正在研究 appcelerator 钛。在我在 KitchenSink 中复制几乎相同的代码来执行 tableview 之后,当我在我的设备中显示它时,我最终得到了一个缩小的 TableView(Galaxy Nexus 上的 android 4)。缩小意味着字体和图像非常小。奇怪的是:1-它在 android 模拟器中显示得恰到好处 2-它在我的 android 设备中显示得恰到好处,但使用的是 KitchenSink 可能是什么问题? 这是该部分的代码:
if (Ti.Platform.name == 'android')
{
Titanium.UI.currentWindow.backgroundColor = '#4e5c4d';
}
else
{
Titanium.UI.currentWindow.backgroundColor = '#aebcad';
}
// create table view data object
var data = [
{title:'Table View (Layout 2)', hasChild:true, test:'../main_windows/profile.js'}
];
// create table view
var tableViewOptions = {
data:data,
style:Titanium.UI.iPhone.TableViewStyle.GROUPED,
headerTitle:'TableView examples and test cases',
footerTitle:"Wow. That was cool!",
backgroundColor:'transparent',
rowBackgroundColor:'white'
};
var tableview = Titanium.UI.createTableView(tableViewOptions);
// create table view event listener
tableview.addEventListener('click', function(e)
{
if (e.rowData.test)
{
var win = Titanium.UI.createWindow({
url:e.rowData.test,
title:e.rowData.title
});
Titanium.UI.currentTab.open(win,{animated:true});
}
});
// add table view to the window
Titanium.UI.currentWindow.add(tableview);
【问题讨论】:
标签: titanium tableview appcelerator android-4.0-ice-cream-sandwich