从MergeAdapter删除视图视图、MergeAdapter

由网友(风月倦怠)分享简介:是否有可能从 MergeAdapter 删除视图或适配器不知何故?我会尽量延长它和片删除的看法,但它是私人。或者,也许有一个替代的解决方案,以显示在此适配器/隐藏看法?我试图将其 layout_height 为零,能见度 View.GONE ,但它仍然显示了空的列表项。先谢谢了。Is it possible to r...

是否有可能从 MergeAdapter 删除视图或适配器不知何故?我会尽量延长它和删除的看法,但它是私人。或者,也许有一个替代的解决方案,以显示在此适配器/隐藏看法?我试图将其 layout_height 为零,能见度 View.GONE ,但它仍然显示了空的列表项。先谢谢了。

Is it possible to remove view or adapter from MergeAdapter somehow? I'd try to extend it and remove the view from pieces but it's private. Or maybe there's an alternative solution to show/hide view in this adapter? I tried to set its layout_height to zero and visibility to View.GONE, but it still shows the empty list item. Thanks in advance.

推荐答案

要删除某个角度还是从 MergeAdapter 适配器使用以下方法:

To remove a view or an adapter from MergeAdapter use the following methods:

SETACTIVE()您mergeAdapter实例。

setActive() on your mergeAdapter Instance.

例如: 要从 MergeAdapter (merAdapter)删除的TextView (mytextView)使用方法:

For Example : To remove a Textview (mytextView) from a MergeAdapter(merAdapter) use:

merAdapter.setActive(mytextViiew,false);

和重新启用它(使其可见)使用:

And to enable it again(to make it visible) use:

merAdapter.setActive(mytextViiew,true);

请参阅该 MergeAdapter 文档细节:

https://github.com/commonsguy/cwac-merge

阅读全文

相关推荐

最新文章