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

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:

主站蜘蛛池模板: 房产| 阿克苏市| 巢湖市| 揭西县| 新宁县| 象山县| 彭水| 宾阳县| 抚顺县| 石渠县| 青阳县| 外汇| 宁化县| 永平县| 富民县| 金坛市| 芦山县| 深州市| 泰安市| 陆川县| 客服| 微山县| 巴东县| 和田市| 宜兰市| 无极县| 正定县| 盱眙县| 舟山市| 特克斯县| 辉南县| 伊春市| 灵丘县| 平乡县| 阜新市| 山阳县| 塔城市| 大埔县| 哈尔滨市| 宜兴市| 民和|