nai

nativescript-android-iosswitch

A lightweight iOS switch view style for Android

Showing:

Popularity

Downloads/wk

1

GitHub Stars

1

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

0

License

MIT

Type Definitions

Built-In

Tree-Shakeable

No?

Categories

Readme

npm npm npm

Nativescript-Android-iOSSwitch

A lightweight iOS switch view style for Android.Feedbacks and PRs are most Welcome.

Demo

alt text

Native Libraries:

Android

luongvo/iOS-SwitchView

Installation

From your command prompt/termial go to your app's root folder and execute:

npm i nativescript-android-iosswitch --save

Usage

XML:

<Page 
    xmlns="http://schemas.nativescript.org/tns.xsd" 
    xmlns:AndroidIosSwitch="nativescript-android-iosswitch" loaded="pageLoaded"> 
    <Page.actionBar>
      <ActionBar title="Nativescript Android iosSwitch" />
  </Page.actionBar>
  <StackLayout height="150" width="80">
   
      <AndroidIosSwitch:AndroidIosSwitch id="sb" color="red"/>
      
       <Button text="True"  tap="{{ onTrue }}" />
       <Button text="false"  tap="{{ onFalse}}" />
      
        
  </StackLayout>
</Page>

TS:

import {AndroidIosSwitch} from 'nativescript-android-iosswitch';
private npb: AndroidIosSwitch;
  constructor(mainPage: Page) {
    super();
    this.npb = <AndroidIosSwitch>mainPage.getViewById('sb');

  }
     public onTrue() {
        this.npb.toggleSwitch(true);
    }
  public onFalse() {
        this.npb.setChecked(false);
    }

Methods

isChecked()

/**

  • @return the state of switch view */

setChecked(boolean)

/**

  • if set true , the state change to on;
  • if set false, the state change to off
  • @param isChecked */

toggleSwitch(boolean)

/**

  • if set true , the state change to on;
  • if set false, the state change to off

  • change state with animation
  • @param isChecked */

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial