zoukankan      html  css  js  c++  java
  • 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');
      };
    
     
    });
  • 相关阅读:
    基于php socket(fsockopen)的应用实例分析
    php多线程的问题
    PHP之fsockopen提交POST数据讲解
    Sort List
    Insertion Sort List
    LRU Cache
    Reorder List
    Word Break II
    Word Break
    Copy List with Random Pointer
  • 原文地址:https://www.cnblogs.com/zry2510/p/6149116.html
Copyright © 2011-2022 走看看