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

多布局时,在 convert() 函数里动态控制 view的显示与隐藏,不起作用, notifyItemChanged(pos); #2514

Closed
Guangxingtianxia opened this issue Oct 27, 2018 · 3 comments

Comments

@Guangxingtianxia
Copy link

holder.itemView.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
int pos = holder.getAdapterPosition();

                if (headerItem.isExpanded()) {

                    // 关闭
                    collapse(pos, false);

                    // 1: 显示某view

                } else {
                    // 开启
                    expand(pos, false);

                      // 2: 隐藏某view
            
                }

                notifyDataSetChanged();
            }
        });

为什么这样的代码,无法控制某一view 的显示与隐藏?

@TomGarden
Copy link

TomGarden commented May 26, 2019

通过 position +1 看起来不错
暂未详究原因
在明了原因之前这不能称为一个解决方案 希望有合理的解决方式

@CymChad
Copy link
Owner

CymChad commented Jul 13, 2019

收到

@shichaohui
Copy link
Collaborator

未能重现该问题,因此先行关闭。
如果您已经解决该问题,可以在下方回复解决方案。
如果您还有遇到此问题,请参考 #2807 重新提交 Issue 。

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

4 participants