简体   繁体   English

Ionic 2禁用向后滑动而不使用导航栏

[英]Ionic 2 disable swipe back without nav-bar

In Ionic 2, I haven't found a way to disable swipe to go back. 在Ionic 2中,我还没有找到一种禁用滑动的方法。 I have injected both NavController and ViewController without finding any function that disables this. 我注入了NavController和ViewController,却没有找到任何禁用它的功能。

The component is full-screen, so I can't use the attributes of nav-bar to disable it. 该组件是全屏的,因此我无法使用nav-bar的属性来禁用它。

SOLUTION: 解:

My app.ts contains a -tag. 我的app.ts包含-tag。 I simply added swipeBackEnabled="false" to it and it disabled swipe-back for all my pages. 我只是向它添加了swipeBackEnabled =“false”,并禁用了所有页面的向后滑动。

Thanks in advance, Markus 马克斯,提前谢谢你

I would leave this as a comment if I had the rep (50). 如果我有代表(50),我会留下这个评论。 Have you taken a look at this thread? 你看过这个帖子了吗? Something like this could go in your constructor: 像这样的东西可以在你的构造函数中:

this.menu = menu;
this.menu.swipeEnable(false);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM