您的位置:首页 > 其它

ionic 隐藏ion-tabs底部导航 hide-tabs

2015-11-23 09:49 519 查看
ionic 隐藏导航,网上以有大神解决了。但好像都是二级页面的。到了三级就不行了。有的是返回就不行了。

ion-tabs导航

<ion-tabs class="tabs-icon-top tabs-color-active-positive {{$root.hideTabs}}">
</ion-tabs>


hideTabs的directive js 注意app=angular.module(‘directive’, [])

app.directive('hideTabs', function($rootScope) {
return {
restrict: 'A',
link: function(scope, element, attributes) {

scope.$on('$ionicView.beforeEnter', function() {

scope.$watch(attributes.hideTabs, function(value){
$rootScope.hideTabs = 'tabs-item-hide';
});
});

scope.$on('$ionicView.beforeLeave', function() {
scope.$watch(attributes.hideTabs, function(value){
$rootScope.hideTabs = 'tabs-item-hide';
});
scope.$watch('$destroy',function(){
$rootScope.hideTabs = false;
})

});
}
};
})


内页需要隐藏导航 hide-tabs=”true”

<ion-view hide-tabs="true" view-title="{{investname}}">
</ion-view>


这样三级导航和返回都没有问题了哦。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: