How to import a widget in alloy titanium

一曲冷凌霜 提交于 2019-12-08 13:58:26

Allright, so first thing you need to do is IMPORT the widget into your project.

If you take a look at the structure of an alloy project you should see in the app folder another folder called "widgets". Copy and Paste the widget inside of it, something like this (the folder name is different because I use another slider):

Then in your view (let's say you have a main view for the slider with a window in it):

<Window id="mainWindow" class="container">
    <Require type="widget" src="com.slider" id="ds"/>
</Window>

Finally, in your config.json:

"dependencies": {       
   "com.slider":"1.0"
   }
 }

gitt.io is also great for finding and installing titanium widgets and modules

CLI installation: http://gitt.io/cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!