Search code examples
titaniumappceleratortitanium-mobileappcelerator-mobile

Javascript Style Sheet in Titanium mobile


I'm a learning mobile development using Titanium Mobile framework.

I am facing a problem related to application of javascript style sheet. When I name my jss file same as the js file, to which the style is to be applied, it works fine. But if I name it something else, it don't work. Can anybody tell me a solution. Following is my code sample.

// app.js
var win = Titanium.UI.createWindow({ backgroundColor : '#fff' });

win.add( Ti.UI.createButton({ title : 'Button A' }) );

win.open();

// app.jss, works fine
button { backgroundImage: 'grdadient_img.png'; }

// button_style.jss, don't work
button { backgroundImage: 'grdadient_img.png'; }

Solution

  • Ammar, please refer the following links. Hope it will help you

    1.How to use jss correctly

    2.How Does .jss feature really works in Titanium mobile SDK