【问题标题】:ExpandableListView animation for a child Android子 Android 的 ExpandableListView 动画
【发布时间】:2014-01-30 16:20:42
【问题描述】:

我正在尝试为ExpandableListView 应用某种动画。我做了一些研究,看起来这是一种正确的痛苦。我设法在展开时应用幻灯片动画,但是我不知道如何在折叠时应用任何东西。

我用过

How to write custom ExpandableListAdapter

我的ExpandableListView。就目前而言,我将此应用于孩子convertView,它在展开时工作正常,但我无法弄清楚它是如何崩溃的。

 Animation fadeAnimation = AnimationUtils.loadAnimation(getContext(), R.anim.slide_left_in);
 convertView.startAnimation(fadeAnimation );

有人可以提供帮助吗,或者有更好的解决方案吗?

【问题讨论】:

    标签: android animation expandablelistview expandablelistadapter


    【解决方案1】:

    我写了一个很好的实现,在这里扩展了 ExpandableListView: https://github.com/idunnololz/AnimatedExpandableListView/

    它使用我在这里解释的想法Android ExpandableListView using animation 来制作动画。

    【讨论】:

      【解决方案2】:

      我对我的ExpandableListView 做了类似的事情。 我使用从 xml 膨胀的自定义子布局。但这应该没关系。
      您应该覆盖 onChildClick onGroupClick 和其他听众。在此侦听器中,您可以为您的东西制作动画。
      您可以尝试使用animateLayoutChanges 对我来说效果不佳。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-01-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-07-23
        • 1970-01-01
        • 2016-06-13
        • 2012-04-01
        相关资源
        最近更新 更多