0
所以我必須將對象添加到Titanium的窗口中,但它們只會在我將它們添加到TableViewRow而不是窗口時顯示。我想添加的兩個項目是profileIcon和flowLabel。這是我在我的頭得到:Titanium:標籤和圖像不會顯示在窗口中
var defaultFontSize = Ti.Platform.name === 'android' ? 16 : 14;
// Function to test if device is iOS 7 or later
function isiOS7Plus()
{
// iOS-specific test
if (Titanium.Platform.name == 'iPhone OS')
{
var version = Titanium.Platform.version.split(".");
var major = parseInt(version[0],10);
// Can only test this support on a 3.2+ device
if (major >= 7)
{
return true;
}
}
return false;
}
var iOS7 = isiOS7Plus();
var theTop = iOS7 ? 59 : 0;
var window = Ti.UI.createWindow({top:theTop});
// Set the background color to non-black to see the status bar
// Or set the Window statusBarStyle property to a non-default value
Ti.UI.setBackgroundColor('#232a35');
var win = Ti.UI.createWindow({
// Remove the status bar
// fullscreen: true
// Moves the Window below the status bar
top: theTop
});
var profileIcon = Ti.UI.createImageView({
image: 'img/[email protected]',
left:15,
verticalAlign: 'center',
width:12, height:14
});
win.add(profileIcon);
var flowLabel = Ti.UI.createLabel({
color:'white',
font:{fontFamily:'Lato-Bold', fontSize:defaultFontSize+2},
text:'Flöde',
textAlign: center,
verticalAlign: center
});
win.add(flowLabel);
win.open();
這是我的BTW開發第一個應用程序和我以前的技能是基於HTML和CSS,所以如果你有任何其他在途中分享提示,請讓我知道。
乾杯!