How do you “Swipe to go back” in Ionic?

眉间皱痕 提交于 2020-01-15 15:30:15

问题


There's nothing in the docs about this.

I've just read a blog post on ionics website saying that it's possible to swipe to go back (like ios7) and I've seen the latest ng-conf where they talked about it as well, but nowhere to they mention on how to implement the damn thing.


回答1:


No need to do a on-swipe-left. The latest version of Ionic provides this, and is defaults to true. As for using this feature, you need to create multiple views, and then just swipe from left, it will take you back to previous view.




回答2:


Ionic has built in gesture events.

Ex.

<div on-swipe-left="swipeleftAction()">
  
  
</div>

So I guess you could place on-swipe-left or on-swipe-right in your page container or div.




回答3:


I have a function that handled removing an item from the array of items,

I programatically closed all options buttons by calling

$ionicListDelegate.closeOptionButtons();


来源:https://stackoverflow.com/questions/29853904/how-do-you-swipe-to-go-back-in-ionic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!