GithubHelp home page GithubHelp logo

nvdnkpr / tintswitch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dbankier/tintswitch

0.0 1.0 0.0 82 KB

A Titanium Module to change the "ON" tint color for Titanium.UI.Switch (iOS)

License: MIT License

tintswitch's Introduction

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:

<modules>
    <module version="0.1" platform="iphone">com.yydigital.tintswitch</module> 
</modules>

Add this line in your app.js file:

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:

var sw = Ti.UI.createSwitch({
  value: true,
  offTint: "red",
  onTint: "green",
  thumbTint: "blue",
  top: 50
});
var sw2 = Ti.UI.createSwitch({
  value: true,
  offImage: "/off.png",
  onImage: "/on.png",
  onTint: 'purple',
  bottom: 50
});

Credits

TiViewShadow was used for guidance in building this module.

tintswitch's People

Contributors

dbankier avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.