문제

I want to use real-time CSS styling in a Titanium app with Pixate. In their documentation, they mention a video which demonstrates how to setup this in XCode.

Another video demonstrates this within a Titanium App, but I didn't find an explanation on how to achieve this.

How can I enable real-time CSS styling?

도움이 되었습니까?

해결책 2

After some digging I did find the way to do it. I'm not sure if this is the intended way, however it works fine.

Put this code in your app.js and the simulator will instantly refresh with changes when saving the CSS file.

var PX = require('com.pixate.framework');
PX.styleSheetFromFilePathWithOrigin({ 
    monitor: true,
    origin: 0,
    filename: '/absolute/path/to/app.css'
});
    // you can add multiple css files to monitor
PX.styleSheetFromFilePathWithOrigin({ 
    monitor: true,
    origin: 0,
    filename: '/absolute/path/to/another_file.css'
});

다른 팁

Pixate maintains a Titanium module for this very purpose.

https://github.com/Pixate/Titanium-Pixate

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top