I used html and css to make these tabs scrolllable. I would like to mention that the scrollable tab feature is not available. However, the solution, below which I understood, works wonders for me.
You can continue to customize the array of tabs with unlimited data.
NOTE: you wonβt be able to scroll the browser during development, but as soon as you install the application, it will work on swipes ... also works in ionic form
HTML code for the section:
<ion-header-bar class="bar bar-header row" align-title="center"> </ion-header> <ion-nav-view> <ion-content> </ion-content> </ion-nav-view> <ion-footer-bar> <div class="auFooter"> <div class="auFooterItem" ng-repeat="tab in tabs" id="tab{{tab.id}}" ng-class="{'IAmActive':tab.id===activeTabId}" ui-sref="{{tab.url}}" ng-click="change_tab({{tab.id}})"> <p> <img src="{{tab.imageurl}}"> </p> <p> {{tab.title}} </p> </div> </div> </ion-footer-bar>
CSS FOR HARD NOTE I use SASS for my css structure:
.pad0{ padding: 0 !important; } .padTop0{ padding-top: 0 !important; } .padBottom0{ padding-bottom: 0 !important; } .padLeft0{ padding-left: 0 !important; } .padRight0{ padding-right: 0 !important; } ion-footer-bar{ @extend .pad0; .auFooter{ height: inherit; background-color:
Javascript to change tab:
$scope.activeTabId='tab1'; $scope.change_tab=function(tabid){ $('#tab1').removeClass("IAmActive"); if($scope.activeTabId!==tabid){ $scope.activeTabId=tabid; } } $scope.initTabs=function(){ $('#tab1').addClass("IAmActive"); } setTimeout($scope.initTabs,500);
json tab sample
$scope.tabs = [ { "id":1, "title" : 'Gallery', "iconoff":'ion-ios-photos', "iconon":'ion-ios-photos', "url":'home', "tabname":"tab-dash", "imageurl":"img/icons/gallery.png" }, { "id":2, "title" : 'Customer Enquiry Form', "iconoff":'ion-android-contact', "iconon":'ion-android-contact', "url":'cenquiry', "tabname":'tab-chats', "imageurl":"img/icons/customer_enquiry.png" }, { "id":3, "title" : 'Top 5', "iconoff":'ion-android-star-half', "iconon":'ion-android-star-half', "url":'top5', "tabname":'tab-top5', "imageurl":"img/icons/top-5.png" } ];