Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbankier/tintswitch
A Titanium Module to change the "ON" tint color for Titanium.UI.Switch (iOS)
https://github.com/dbankier/tintswitch
Last synced: 2 months ago
JSON representation
A Titanium Module to change the "ON" tint color for Titanium.UI.Switch (iOS)
- Host: GitHub
- URL: https://github.com/dbankier/tintswitch
- Owner: dbankier
- License: mit
- Created: 2012-10-15T02:02:22.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-12-04T21:42:31.000Z (about 10 years ago)
- Last Synced: 2024-04-08T16:42:49.226Z (9 months ago)
- Language: Python
- Size: 399 KB
- Stars: 28
- Watchers: 6
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
TintSwitch
==========This module extends the Titanium Switch to allow changing the "ON" color from the default blue color to any defined color.
_UPDATED_: You can now change the on, off, and toggle tints as well as
the on and off images. API has changed. See the example.**NOTE**: This module is for use with iOS 5 and above and iOS only.
Compiled module is available in the _Downloads_ section.
Usage
-----Add the following to your tiapp.xml file:
```javascript
com.yydigital.tintswitch
```
Add this line in your app.js file:
```javascript
require('com.yydigital.tintswitch');
```The module provides no public api. It's simply used for extending the TiUISwitch class provided by the Ti SDK with additional functionality.
You will then have a the `onTint`, `offTint`, `thumbTint`, `onImage`,
`offImage` that can be used as follows:```javascript
var sw = Ti.UI.createSwitch({
value: true,
offTint: "red",
onTint: "green",
thumbTint: "blue",
top: 50
});
``````javascript
var sw2 = Ti.UI.createSwitch({
value: true,
offImage: "/off.png",
onImage: "/on.png",
onTint: 'purple',
bottom: 50
});
```Credits
-------[TiViewShadow](https://github.com/omorandi/TiViewShadow) was used for guidance in building this module.