当你有一个图标和一个文本时,我真的很喜欢 Ionic 3 中选项卡的样式:
https://ionicframework.com/docs/components/#tabs-icon-text
但是在我使用的应用程序中,我有 4 个操作。比如打开相机,打开谷歌地图等等。而这个我想以这种风格完全显示在页面底部。
我怎样才能做到这一点,因为这不是选项卡的真正目的,而且我还没有找到类似的组件。
最佳答案
就像你在the Tab docs中看到的一样:
Sometimes you may want to call a method instead of navigating to a new page. You can use the
(ionSelect)
event to call a method on your class when the tab is selected.
<ion-tabs>
<ion-tab (ionSelect)="chat()" tabTitle="Show Modal"></ion-tab>
</ion-tabs>
然后
export class Tabs {
constructor(public modalCtrl: ModalController) {}
chat() {
let modal = this.modalCtrl.create(ChatPage);
modal.present();
}
}
关于android - 使用 ionic 选项卡进行操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45170325/