npm i --save nativescript-slider
- Version: 1.0.1
- GitHub: https://github.com/kazemihabib/nativescript-slider
- NPM: https://www.npmjs.com/package/nativescript-slider
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
Nativescript Slider
It's a fork of https://github.com/NativeScript/NativeScript/tree/master/tns-core-modules/ui/slider (tns core module) with dragged event.
What's the difference?
Added dragged event that fires when the user drags the slider.
currently this event added just for android.
Why should I use this event when I can use two-way binding for value property of slider?
It is usefull when the value can change programmatically and by user for example when creating player.
Installation
tns plugin add nativescript-slider
Usage
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:seekbar="nativescript-slider"
loaded="pageLoaded">
<StackLayout>
<seekbar:Slider value="50" maxValue="100" dragged="{{dragged}}" />
</StackLayout>
</Page>
dragged(args){
let newValue = args.newValue;
let object = args.object;
}
How to use with Angular2
import {registerElement} from "nativescript-angular/element-registry";
registerElement("TNSSlider", () => require("nativescript-slider").Slider);
<TNSSlider [value]="currentPosition" [maxValue]="movieLength" (dragged)="fromUser($event)" ></TNSSlider>