titanium开发教程-01-04使用label view

1

 

var win = Titanium.UI.createWindow({
	title:"文本视图",
	backgroundColor:"#FFFFFF",
	exitOnClose:true
})

var label01 = Titanium.UI.createLabel({
	text:"文本标签 01",
	top:0,
	left:0,
	height:24,
	width:"100%",
	textAlign:"center",
	color:"#FFFFFF",
	backgroundColor:"#363F45"
});

var label02 = Titanium.UI.createLabel({
	text:"文本标签 02",
	top:24,
	right:0,
	height:36,
	width:"75%",
	textAlign:"left",
	color:"#000000",
	backgroundColor:"#FEB41C",
});

var label03 = Titanium.UI.createLabel({
	text:"文本标签 03",
	bottom:0,
	height:"25%",
	width:"75%",
	textAlign:"right",
	font:{fontSize:36, fontStyle:"italic"},
	color:"#F1ECB5",
	backgroundColor:"#371740",
});

var label04 = Titanium.UI.createLabel({
	text:"文本标签 04" //默认情况下,标签的位置在该屏幕的中心,左对齐
})

win.add(label01);
win.add(label02);
win.add(label03);
win.add(label04);

win.open();
posted @ 2012-03-16 18:52  校长阿四  阅读(607)  评论(0编辑  收藏  举报