android - 使用 ionic 选项卡进行操作

标签 android ionic2 ionic3

当你有一个图标和一个文本时,我真的很喜欢 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/

相关文章:

android - 在 WebView 中调用条形码扫描仪而不是键盘

java - Admob 不支持 webview

android - Ionic with visual studio 总是提示未安装 node.js。即使我使用的是 Node.js (6.7.0)。从 Node 命令提示符运行 android

angular - ionic3/Angular 4 : Injecting a service in another service not working

java - 如何使用 RXJava Observables 处理用于填充模型的多个请求?

android - 只能通过一个帐户登录,不能使用另一个ID登录Facebook

ionic-framework - 'ionic cordova run android' 命令卡住了 11 分钟

angularjs - 使用 Ionic 2 的 HTTP 发布

android - 错误 : cmd: Command failed with exit code ENOENT while running app into android apk

forms - ionic 3 形式仍然警告我 : "Password field is not contained in a form"