我是 Ionic 新手,这是我的第一个项目。我正在创建一个底部带有选项卡导航的小应用程序。
一个选项卡 View 如下所示:
<ion-view title="Account">
<ion-content class="has-header padding">
<h1>Account</h1>
</ion-content>
</ion-view>
我想在“帐户”旁边的标题中添加一个按钮,根据文档,您使用 ion-nav-bar 元素,但当我尝试此操作时,没有显示任何按钮。谁能告诉我如何在选项卡 View 的标题中添加按钮?
最佳答案
您可以像这样使用 ion-nav-button :
<ion-view title="Account">
<ion-nav-buttons side="left">
<button class="button" ng-click="doSomething()">
I'm a button on the left of the navbar!
</button>
</ion-nav-buttons>
<ion-content class="has-header padding">
<h1>Account</h1>
</ion-content>
</ion-view>
关于AngularJS 和 Ionic。标题、选项卡 View 中的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24627304/