This is a widget for the Alloy MVC framework of Appcelerator's Titanium platform.
- Simply swippig between pages.
- Works on Android (tested on SDK 7.0.2), iOS
- Unzip the folder to your project under
com.developatic.pagingControl
.
In config.json add :
"dependencies": {
"com.developatic.pagingControl": "1.0"
}
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
});
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. |