- Ionic:Hybrid Mobile App Development
- Rahat Khanna Sani Yusuf Hoc Phan
- 229字
- 2021-07-09 19:00:35
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:

- Vue 3移動Web開發與性能調優實戰
- Vue.js快跑:構建觸手可及的高性能Web應用
- Mastering QGIS
- Swift 3 New Features
- HTML5 and CSS3 Transition,Transformation,and Animation
- 批調度與網絡問題的組合算法
- SQL基礎教程(第2版)
- Unity 2018 Augmented Reality Projects
- Python語言科研繪圖與學術圖表繪制從入門到精通
- Hadoop 2.X HDFS源碼剖析
- Swift語言實戰晉級
- jQuery從入門到精通(微課精編版)
- Offer來了:Java面試核心知識點精講(框架篇)
- Building Web and Mobile ArcGIS Server Applications with JavaScript(Second Edition)
- Python機器學習