Titanium颜色总结

1:Windows背景Gradient的做法:

可以用背景图也可以用Gradient: 参考 http://docs.appcelerator.com/titanium/2.1/index.html#!/api/Titanium.UI

 1 //create tab Group

 2 var tabGroup = Ti.UI.createTabGroup();

 3 

 4 //create the Sampler window,使用背景图

 5 var win1 = Ti.UI.createWindow({

 6     width: 320,

 7     height: 480,

 8     top: 0,

 9     left: 0,

10     backgroundImage:'BackGround.png',

11     title:'SAMPLERS',

12     barImage: 'navbar.png'

13 });

14 //create the Sampler window,使用Gradient色块填充

15 var win2 = Ti.UI.createWindow({

16     width: 320,

17     height: 480,

18     top: 0,

19     left: 0,

20     backgroundGradient:{

21         type: 'linear',

22         startPoint: {x:'50%', y:'0%'},

23         endPoint: {x:'50%', y:'100%'},

24         colors:[{color: 'rgb(73,81,92)', offset: 0.25}, {color: 'rgb(42,47,53)', offset: 1.0}],

25     },

26     title:'TOOLS',

27     barImage: 'navbar.png'

28 });

你可能感兴趣的:(Titanium)