I want to create a stylesheets for my Titanium app. I'm not using Alloy framework, so how i can use app.tss? in which directory i need to store it?
Thank you
I want to create a stylesheets for my Titanium app. I'm not using Alloy framework, so how i can use app.tss? in which directory i need to store it?
Thank you
You can use CommonJS to achieve this
resources/styles.js
exports.Window = {
backgroundColor: 'blue',
backgroundImage: '/images/homebg.png',
exitOnClose: true
};
exports.Label = {
color: 'gray',
textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,
backgroundColor: 'transparent',
font: {
fontFamily:'Helvetica',
fontSize: '12dp',
fontStyle: 'normal',
fontWeight: 'normal'
}
};
Usages
var homeWin = Ti.UI.createWindow(require('styles').Window);
You can also refer this
You can't.
.tss files are features bring by Alloy. However, if you want to use custom styles, you may have a look to the applyProperties method.
You can maybe do some workaround like this :
http://tifiddle.com/e9b87d0f3debd5e4a7bab3beb03dbddd