如何在ionic中禁用IOS平台的滑动效果 [英] how to disable swipe effect of IOS platform in ionic
问题描述
我是 Ionic 的新手.我正在使用离子空白模板创建一个 phonegap 应用程序.当我在应用程序的第二页上从左向右滑动时,会出现黑屏.我不知道它来自哪里.我无法返回上一页.我需要杀死该应用程序才能解决此问题.以下是滑动前后的代码:
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 from where it comes.I cant go back to previous page.I need to kill the app to solve this issue. Following are code before and after the swipe :
之前:
<ion-nav-view nav-view-transition="ios" nav-view-direction="forward" class="view-container disable-user-behavior" nav-swipe="">
<ion-pane class="pane" nav-view="active" style="opacity: 1; box-shadow: rgba(0, 0, 0, 0) 0px 0px 10px; -webkit-transform: translate3d(0%, 0px, 0px);">
<form name="memberInfo" ng-submit="saveMemberInfo(data)" class="ng-pristine ng-valid">
......
</ion-pane>
</ion-nav-view>
之后:
<ion-nav-view nav-view-transition="ios" nav-view-direction="back" class="view-container disable-user-behavior" nav-swipe=""><ion-pane class="pane" nav-view="active" style="opacity: 1; box-shadow: rgba(0, 0, 0, 0.298039) 0px 0px 10px; -webkit-transform: translate3d(0%, 0px, 0px); -webkit-transition: 0ms; transition: 0ms;">
<form name="memberInfo" ng-submit="saveMemberInfo(data)" class="ng-pristine ng-valid">
........
</ion-pane><div class="pane" nav-view="cached" style="opacity: 0.9; -webkit-transform: translate3d(-33%, 0px, 0px); -webkit-transition: 0ms; transition: 0ms;"></div></ion-nav-view>
此问题仅在ios中出现.
This issue is only appears in ios.
有人知道这个问题是怎么来的吗?
anybody knows how this issue is coming ?
推荐答案
根据Ionic forum 只需在 AngularJS 模块的配置中使用以下代码行:
According to the Ionic forum just use the following line of code in the config of your AngularJS module:
$ionicConfigProvider.views.swipeBackEnabled(false);
这篇关于如何在ionic中禁用IOS平台的滑动效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!