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

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:

主站蜘蛛池模板: 花垣县| 城固县| 云霄县| 监利县| 静宁县| 屏南县| 平罗县| 余姚市| 册亨县| 苍南县| 湖南省| 三台县| 尼勒克县| 平舆县| 郁南县| 阿克陶县| 宁阳县| 平昌县| 唐海县| 海林市| 光山县| 濉溪县| 周宁县| 卓资县| 阿拉善盟| 宝清县| 登封市| 嘉祥县| 浮梁县| 勃利县| 金平| 山丹县| 台安县| 乐都县| 曲水县| 象州县| 锡林郭勒盟| 铅山县| 郓城县| 开化县| 莫力|