Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

Sliding tab - Redirect to perticular tab

$
0
0

I had downloaded this sliding tab app Click here (View Pager) for alloy android project.

Its working fine, But I have to redirect to particular tab instead of every time it redirects to 1st tab when i Open that page. How can I do that?

In my scrollingTab.js

var pagerModule = require("net.bajawa.pager");
 
var dummyTableData = (function () {
    var a = [];
    for (var i=0; i < 100; i++) a.push({ title: "I am item " + i ,height:"60dp",color:'#fff'});
    return a;
}());
 
var pagerDataScrolling = [
    { title: "First tab",   view: Ti.UI.createTableView({ data: dummyTableData }) },
    { title: "Second tab",  view: Ti.UI.createTableView({ data: dummyTableData }) },
    { title: "Third tab",   view: Ti.UI.createTableView({ data: dummyTableData }) },
    { title: "Fourth tab",  view: Ti.UI.createTableView({ data: dummyTableData }) },
    { title: "Fifth tab",   view: Ti.UI.createTableView({ data: dummyTableData }) },
    { title: "Sixth tab",   view: Ti.UI.createTableView({ data: dummyTableData }) },
    { title: "Seventh tab", view: Ti.UI.createTableView({ data: dummyTableData }) },
    { title: "Eight tab",   view: Ti.UI.createTableView({ data: dummyTableData }) }
    ];
 
var opts={
    data: pagerDataScrolling,
    tabs: {
        style: pagerModule.SCROLLING,
        backgroundColor: "#000000",
        backgroundColorSelected: "#000000",
        lineColor: "#0082AB",
        lineColorSelected: "#0082AB",
        lineHeight: 5,
        lineHeightSelected: 10,
    },
    indicator: {
        style: pagerModule.LINE
    }
};
 
var viewPager = pagerModule.createViewPager(opts);
 
$.ScrollingTab.add(viewPager);
 
$.ScrollingTab.open();
I have to redirect directly to 4th tab(any tab other than 1st) when I open this scrollingTab, so what can be the solution?

Viewing all articles
Browse latest Browse all 7655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>