找到你要的答案

Q:how to disable swipe effect of IOS platform in ionic

Q:如何在离子禁用iOS平台刷卡效果

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 :

before :

<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>

after :

<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>

This issue is only appears in ios.

anybody knows how this issue is coming ?

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。

有人知道这个问题是怎么来的吗?

answer1: 回答1:

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

$ionicConfigProvider.views.swipeBackEnabled(false);

根据离子论坛只使用下面这行代码在你的AngularJS模块配置:

$ionicConfigProvider.views.swipeBackEnabled(false);
answer2: 回答2:

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>

在最新版本的离子你也可以禁用刷卡回去功能只为某些意见,通过使用可以刷卡=“假”离子视图。

<ion-view can-swipe-back="false"></ion-view>
answer3: 回答3:

I wrote below code in app.js file .

angular.module(....)
.config(function($stateProvider,$urlRouterProvider,$ionicConfigProvider){

    $ionicConfigProvider.views.swipeBackEnabled(false);

.
.
.
.//remaining code in config
}

我写了下面的代码在app.js文件。

angular.module(....)
.config(function($stateProvider,$urlRouterProvider,$ionicConfigProvider){

    $ionicConfigProvider.views.swipeBackEnabled(false);

.
.
.
.//remaining code in config
}
answer4: 回答4:

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

$ionicPlatform.views.swipeBackEnabled(false);

如果以上代码不工作,可以在运行函数中添加:

$ionicPlatform.views.swipeBackEnabled(false);
ionic