Multi Pages on PagingControl
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
controllers
styles
views
README.md
widget.json

README.md

com.developatic.pagingControl

This is a widget for the Alloy MVC framework of Appcelerator's Titanium platform.

Features

  • Simply swippig between pages.
  • Works on Android (tested on SDK 7.0.2), iOS

Working Example

Imgur

Quick Start

  • Unzip the folder to your project under com.developatic.pagingControl.

In config.json add :

"dependencies": {
        "com.developatic.pagingControl": "1.0"
}

Usage

XML:

<Alloy>
    <Window class="container" >
       <Widget id="pagingcontrol" src="com.developatic.pagingControl"/>
    </Window>
</Alloy>

JS:

var views = [];
for (var i=0; i < 10; i++) {
   var view = Ti.UI.createView({
     height : 500,
     width : 250,
     backgroundColor : (i%2 == 0) ? 'black' : 'red'  
   });
   views.push(view);
};

$.pagingcontrol.setViews(views,{
  widthOfView : 250, 
  margin : 20,
  showIndicator : true // false by default
});

Methods

Name Params Description
setViews (views : Array<Titanium.UI.View>, params : { widthOfView : number, margin : number, showIndicator : bool }) Sets the value of the views property, and sets the width of views and margin between them.
moveToPage index : number Sets the value of the currentPage property.
moveNext null Sets the current page to the next consecutive page in views.
movePrevious null Sets the current page to the previous consecutive page in views.