Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

侧滑内容控制 #315

Open
zhongdevin opened this issue Dec 15, 2021 · 2 comments
Open

侧滑内容控制 #315

zhongdevin opened this issue Dec 15, 2021 · 2 comments

Comments

@zhongdevin
Copy link

你好,是哪个方法控制的,不同的type显示不同菜单,有些不需要侧滑,是怎么控制的

@luqiming666
Copy link

应该是可以的。可以看到:在SwipeMenuCreator接口的onCreateMenu方法,每次创建菜单时position参数都会回调进来:

  1. Adapter.getItemViewType(position)获取position对应的viewtype,然后创建对应的侧滑菜单
  2. 不需要侧滑菜单的,通过mRecyclerView.setSwipeItemMenuEnabled(int position, boolean enabled) 设置

@luqiming666
Copy link

本项目的xSample也要示例代码:
“Item中的横竖菜单”-> “根据ViewType定制菜单”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants