ionic project

2016/08/02 ionic

1:ionic项目

中文地址

ionic 项目遇到的问题

隐藏tab 标签

1:在tab.html中ion-tabs标签加入:

<ion-tabs ng-class="{'tabs-item-hide':$root.hideTabs}"></ion-tabs>

2: 在app.js中加入

angular.module('hideTabBar', [])
.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 = value;

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


        });
        }
        };
});

3:在需要隐藏的界面ion-view中加入

hide-tabs="true"

例如: <ion-view hide-tabs="true"></ion-view>


禁止右滑finish当前页面

在app.js中config $ionicConfigProvider.views.swipeBackEnabled(false);