如何在离子中禁用IOS平台的滑动效果 [英] how to disable swipe effect of IOS platform in ionic

查看:145
本文介绍了如何在离子中禁用IOS平台的滑动效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ionic的新手。我正在使用离子空白模板创建一个phonegap应用程序。
当我在我的应用程序的第二页上从左向右滑动时,会出现黑屏。我不知道它来自哪里。我不能回到上一页。我需要杀死应用程序才能解决这个问题。
以下是刷卡之前和之后的代码:



之前:

 < ion-nav-view nav-view-transition =iosnav-view-direction =forwardclass =view-container disable-user-behaviornav-swipe => 
< ion-pane class =panenav-view =activestyle =opacity:1; box-shadow:rgba(0,0,0,0)0px 0px 10px; -webkit-transform :translate3d(0%,0px,0px);>
< form name =memberInfong-submit =saveMemberInfo(data)class =ng-pristine ng-valid>
......
< / ion-pane>
< / ion-nav-view>

之后:

 < ion-nav-view nav-view-transition =iosnav-view-direction =backclass =view-container disable-user-behaviornav-swipe => < ion-pane class =panenav-view =activestyle =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 =memberInfong-submit =saveMemberInfo(data)class =ng-pristine ng-valid>
........
< / ion-pane>< div class =panenav-view =cachedstyle =opacity:0.9; -webkit-transform: translate3d(-33%,0px,0px); -webkit-transition:0ms; transition:0ms;>< / div>< / ion-nav-view>

此问题仅出现在ios中。



<有谁知道这个问题会怎样?

解决方案

根据离子论坛只需在AngularJS模块的配置中使用以下代码行:

  $ ionicConfigProvider.views.swipeBackEnabled(false); 


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 ?

解决方案

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

$ionicConfigProvider.views.swipeBackEnabled(false);

这篇关于如何在离子中禁用IOS平台的滑动效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆