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

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:

主站蜘蛛池模板: 定南县| 禹城市| 托里县| 平湖市| 忻州市| 上饶县| 长沙市| 阳曲县| 蒙阴县| 图木舒克市| 宁武县| 贵港市| 金湖县| 错那县| 汉中市| 小金县| 灵寿县| 萝北县| 光山县| 霍州市| 海伦市| 庄浪县| 莱西市| 那曲县| 岳阳市| 嘉禾县| 姜堰市| 彭水| 曲靖市| 固原市| 新乐市| 定西市| 紫金县| 澜沧| 咸宁市| 云阳县| 石首市| 师宗县| 景东| 湘阴县| 曲阳县|