Skip to content
slider plugin for nativescript
TypeScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
.gitignore
.npmignore
LICENSE
README.md
developepackage.json
index.d.ts
package.json
publishpackage.json
slider-common.ts
slider.android.ts
slider.ios.ts
tsconfig.json

README.md

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>
You can’t perform that action at this time.