官术网_书友最值得收藏!

Ionic Tabs

Ionic Tabs is a collection of important directives for creating a tab-based layout for a section of your mobile app. We have already seen how the tabs directive is used in the tabs starter template.

Ionic Tabs is a collection of two directives and one service. The directives are <ion-tabs> used to define the collection or group of tabs, and the <ion-tab>, directive, which is used to define a specific tab. The service $ionicTabsDelegate is used to control the tabs from JavaScript in order to select a specific tab.

The <ion-tabs> directive

It provides a multi-tabbed interface with a set of tabs and multiple views that can be switched. The tabs CSS classes are used to set the styling of the tabs group. The class name tabs should be used along with the following classes for specific styles:

The <ion-tabs> directive has one attribute that enables you to pass a custom handle for the delegate as shown in the following table:

The <ion-tab> directive

Inside the <ion-tab> directive, we can use one or multiple <ion-tab> directives. The tab content can be included in the <ion-tab> directive, which will be shown only when the specific tab is selected. Each <ion-tab> has its own navigation history and should include its own named <ion-nav-view>.

The following is the usage of this directive:

<ion-tab
  title="Custom Tab"
  icon="ion-star"
  href="#/book/favourites"
  on-select="goToFavourites()"
  on-deselect="unsetFavourites()">
</ion-tab>

The important attributes available on the <ion-tab> directive and their functions is outlined in the following table:

主站蜘蛛池模板: 玉树县| 鄂尔多斯市| 临武县| 察隅县| 栖霞市| 绥德县| 漳州市| 宜丰县| 甘孜县| 紫阳县| 屏东市| 珲春市| 吴川市| 焦作市| 兴义市| 旬邑县| 景泰县| 曲水县| 饶阳县| 永登县| 长泰县| 维西| 通道| 桃园市| 江永县| 昆山市| 长岛县| 敖汉旗| 保靖县| 天全县| 桂东县| 长海县| 齐齐哈尔市| 邳州市| 尼木县| 建昌县| 南平市| 渝中区| 孝义市| 榆中县| 江阴市|