0
我正在从事Ionic 1项目。我试图在其中一个视图内有一个后退按钮的导航栏,但没有出现。我在Chrome上进行了检查,发现后退按钮的类别变为hide
。无论如何,我可以让它出现?离子导航栏的视图
这里是我的代码:
<ion-view ng-controller="GuDetailCtrl">
<ion-nav-bar class="bar-positive">
<ion-nav-back-button class="button-icon ion-arrow-left-c show">
</ion-nav-back-button>
</ion-nav-bar>
<ion-content class="padding">
<div class="list">
<label class="item item-input">
<span class="input-label">Name</span>
<span>{{hotel.name}}</span>
</label>
<label class="item item-input">
<span class="input-label">Locality</span>
<span>{{hotel.locality}}</span>
</label>
<label class="item item-input">
<span class="input-label">Amenities</span>
<span>{{hotel.amenities}}</span>
</label>
</div>
<button class="button button-positive" ng-click="modal.show()">
Create Booking
</button>
<script id="templates/booking.html" type="text/ng-template">
<ion-modal-view>
<ion-header-bar class="bar bar-header bar-positive">
<h1 class="title">New Booking</h1>
<button class="button button-clear button-primary" ng-click="modal.hide()">Cancel</button>
</ion-header-bar>
<ion-content class="padding">
<div class="list">
<label class="item item-input">
<span class="input-label">Check-in Date</span>
<input ng-model="newBooking.inDate" type="date">
</label>
<label class="item item-input">
<span class="input-label">Check-out Date</span>
<input ng-model="newBooking.outDate" type="date">
</label>
<label class="item item-input">
<span class="input-label">No. of Rooms</span>
<input ng-model="newBooking.rooms" type="number">
</label>
<button class="button button-full button-positive" ng-click="createBooking(newBooking)">Create</button>
</div>
</ion-content>
</ion-modal-view>
</script>
</ion-content>
</ion-view>
这个网页从另一个页面导航到。父页面没有导航栏,所以我不能有一个通用的导航栏类。我尝试在我的代码中使用'bar-royal'。颜色改变了,但后退按钮仍然不显示。 –
好的,我想你需要看到这个[链接](https://stackoverflow.com/questions/32598893/how-to-force-ionic-display-back-button-on-certain-page)希望它能帮助你。 –
谢谢!使用'$ ionicHistory'为我工作。 :) –