我正在研究加速器鈦。在我將KitchenSink中幾乎相同的代碼複製到TableView中之後,當我將其顯示在我的設備(Galaxy Nexus上的android 4)中時,我最終放大了TableView。縮小意味着字體和圖像非常小。奇怪的是:1-它在android模擬器中正確顯示2-它顯示在我的android設備中,但是使用了KitchenSink 有什麼問題? 這裏是那部分代碼:我不得不改變tiapp.xml文件並添加行Appcelerator titanium TableView with Android 4.x縮小放大
:
<supports-screens android:anyDensity="false"/>
在Android mainfest部分 所以
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);