Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

add transitions to the tab in iOS and android

$
0
0

Application type:mobile,titanium sdk:3.5.1,titanium studio:3.4.2,platform:android and iOS,Device:simulator,emulator,OS:Mac OSX10.9.5,

How to have animations for the tab in iPhone and android while moving from one tab to another tab. I have seen in documentation that from iOS 7 Ti.UI.Tab supports transitions.But I am unable to do.Can anyone please help me.

index.xml

<Alloy>
<TabGroup id="tabGroup">
    <Tab title="tab1">
        <Window backgroundColor="red" id="tabWin1"></Window>
    </Tab>
    <Tab title="tab2">
        <Window backgroundColor="#bdbdbd" id="tabWin2"></Window>
    </Tab>
    <Tab title="tab3">
        <Window backgroundColor="#38c" id="tabWin3"></Window>
    </Tab>
    <Tab title="tab4">
        <Window backgroundColor="blue" id="tabWin4"></Window>
    </Tab>
</TabGroup>
</Alloy>
index.js
$.tabGroup.open();
$.tabGroup.addEventListener('swipe', function(e) {
   var activeTabIndex=$.tabGroup.tabs.indexOf($.tabGroup.activeTab);
   if(e.direction==='right'&&activeTabIndex>0) {
      $.tabGroup.setActiveTab(activeTabIndex-1);
    } else if(e.direction==='left'&&activeTabIndex<$.tabGroup.tabs.length-1) {
       $.tabGroup.setActiveTab(activeTabIndex+1);
    }
});

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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