how to disable swipe effect of IOS platform in ionic

前端 未结 5 2018
温柔的废话
温柔的废话 2021-01-01 19:24

I\'m new to Ionic . I\'m creating an phonegap app using ionic blank template. When i swipe from left to right on second page of my app a black screen appears. I don\'t know

相关标签:
5条回答
  • 2021-01-01 19:52

    In case code above is not working: in the run function you can add:

    $ionicPlatform.views.swipeBackEnabled(false);
    
    0 讨论(0)
  • 2021-01-01 20:02

    In the latest version of ionic you can also disable the swipe to go back feature only for certain views by using can-swipe-back="false" on ion-view.

    <ion-view can-swipe-back="false"></ion-view>
    
    0 讨论(0)
  • 2021-01-01 20:05

    According to the Ionic forum just use the following line of code in the config of your AngularJS module:

    $ionicConfigProvider.views.swipeBackEnabled(false);
    
    0 讨论(0)
  • 2021-01-01 20:10

    I wrote below code in app.js file .

    angular.module(....)
    .config(function($stateProvider,$urlRouterProvider,$ionicConfigProvider){
    
        $ionicConfigProvider.views.swipeBackEnabled(false);
    
    .
    .
    .
    .//remaining code in config
    }
    
    0 讨论(0)
  • 2021-01-01 20:16

    In my case, there's a workaround using $ionicSideMenuDelegate.

    $ionicSideMenuDelegate.canDragContent(false);
    

    Of course, you should inject the delegate into the controller's dependencies.

    0 讨论(0)
提交回复
热议问题