ionic开发中页面跳转隐藏底部Ttab
1.在ion-tabs后添加
<ion-tabs class="tabs-icon-top tabs-balanced" ng-class="{'tabs-item-hide':$root.hideTabs}">
2.在app.js中添加
.directive('showTabs', function ($rootScope) {
return {
restrict: 'A',
link: function ($scope, $el) {
$rootScope.hideTabs = false;
}
};
})
.directive('hideTabs', function ($rootScope) {
return {
restrict: 'A',
link: function ($scope, $el) {
$rootScope.hideTabs = true;
}
};
})
3.隐藏,在设备需要隐藏的页面中的ion-view后添加
<ion-view view-title="demo" hide-tabs>
4.在母控制中添加 $rootScope
angular.module('starter')
.controller('DashCtrl', function($scope, $state, $http, $ionicPopup, AuthService,$rootScope) {
// 显示控制器
$scope.$on('$ionicView.enter',function(){
$rootScope.hideTabs=false;
})
$scope.logout = function() {
AuthService.logout();
$state.go('login');
};
});

浙公网安备 33010602011771号