【问题标题】:Set Animation For Expandable List down/up向下/向上设置可扩展列表的动画
【发布时间】:2016-12-17 20:27:34
【问题描述】:

如何使用扩展 BaseExpandableListAdapter 的自定义适配器为可扩展列表设置动画(展开/折叠)?

更新: 像这样:https://www.youtube.com/watch?v=J7rcFRKvpyY

【问题讨论】:

标签: android list animation expandable


【解决方案1】:

您需要将其包含在布局文件中,在列表的父级中

android:animateLayoutChanges="true"

然后在您的活动中的 onCreate() 中进行类似的操作。

    LinearLayout layout = (LinearLayout)findViewById(R.id.list_container);
    LayoutTransition t = layout.getLayoutTransition();
    t.setDuration(200);            // 200ms
    layout.setLayoutTransition(t);

您可以了解更多关于使用 LayoutTransition here

【讨论】:

  • 很抱歉没有帮到你。你注意到视频描述中的 GitHub 链接了吗? link
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-08-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-08-08
相关资源
最近更新 更多