search

Home  >  Q&A  >  body text

交互 - Android版“微信,知乎”app的“右滑返回”功能是如何实现的?

某次点击打开一个新页面后,在屏幕任意位置(微信需在屏幕左边边缘)向右滑动,即可实现返回的功能,同时还可以实时看到滑动状态。

请问这是如何实现的?

PHP中文网PHP中文网2772 days ago891

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 14:25:36

    Phew, I just finished writing this function, please stay tuned for the release of SegmentFault for Android 2.6~
    The solution I used is this ikew0ng/SwipeBackLayout

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 14:25:36

    There are many ways to implement it.
    One is to monitor gestures directly in the activity and move the DecorView.
    One is to add a layer of defined views between DecorView and its subviews to handle gestures and effects. That's the one upstairs.

    https://github.com/Jude95/SwipeBackHelper
    Here are some improvements I made to ikew0ng/SwipeBackLayout.

    reply
    0
  • Cancelreply