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');
      };
    
     
    });
  • 相关阅读:
    centos 安装Phpstorm
    PostgreSQL 里面的 BIGSERIAL
    如何下载symfony
    换行
    javaScript 真经 小感 this 指向
    css3 抖动
    jq 抖动效果
    还是 js 替代 vw vh 了
    常用 Math 属性及方法
    js 判断浏览器类型及版本
  • 原文地址:https://www.cnblogs.com/zry2510/p/6149116.html
Copyright © 2011-2022 走看看