【问题标题】:How to hide bottom layout from Swipe-to-reveal RecyclerView menu item when user scrolls?用户滚动时如何从滑动显示 RecyclerView 菜单项中隐藏底部布局?
【发布时间】:2018-10-12 20:27:33
【问题描述】:

我使用this class(代码很多,这里就不贴了)来实现Swipe-to-reveal动作,当用户在RecyclerView中的任何CardView项上从右向左滑动时,底部布局显示有一些按钮。当用户从左向右滑动时,底部布局被隐藏:

一切都很好,但我想实现允许用户在滚动时使用额外按钮自动隐藏底部布局的效果。上面的类中有名为 open()close() 的方法,我试图在 onDown() 方法中调用它们:

 mDragHelper.smoothSlideViewTo(mMainView, mRectMainClose.left, mRectMainClose.top);

但我收到此错误:

  • 尝试在空对象引用上调用虚拟方法“int android.view.View.getLeft()”

【问题讨论】:

    标签: android scroll swipe


    【解决方案1】:

    从 chthai64 找到这个 very awesome library named SwipeRevealLayout

    也许有人会觉得这很有用,我做到了!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-20
      • 1970-01-01
      • 2014-02-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-11
      相关资源
      最近更新 更多