JKnorr91 / ion-slide-box-tabs

An Add-On directive for the ion-slide-box, that adds tabs to the slide box, known from the Android Material Design specification
MIT License
248 stars 110 forks source link

Enable tabs scroll on android #43

Closed savkelita closed 7 years ago

savkelita commented 7 years ago

First of all excellent work!

Question 1: Is it possible to active scroll (menu tabs) on android devices or they can only be static? Question 2: How to call a controller when the tab is changed? Because i have a different views.

Thanks!

savkelita commented 7 years ago

I found a solution.

  1. Enable scroll on tabs list put this line inside CSS:
ion-scroll{
    overflow: auto !important;
}

2. Example:

View:

<ion-slide-box on-slide-changed="slideChanged(index)" slide-tabs-scrollable="true" show-pager="false" ion-slide-tabs>
            <ion-slide ion-slide-tab-label="News">
              <div ng-include src="'templates/news.html'"></div>
            </ion-slide>
</ion-slide-box>

Controller:

$scope.slideChanged = function(slideNum) { switch (slideNum) { case 0: console.log("CASE 0"); break; case 1: console.log("CASE 1"); break; case 2: console.log("CASE 2"); break; } };

Happy coding :)