【问题标题】:Android drawable animation?Android可绘制动画?
【发布时间】:2018-09-21 15:54:47
【问题描述】:

是否可以做这样的动画:Animation GIf

如果可能的话,有人可以指导我吗?

【问题讨论】:

标签: android animation drawable animationdrawable


【解决方案1】:

LikeButton 库被设计用来创建这样的按钮。

首先确保使用 JitPack 依赖 url:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

然后将此依赖项添加到您的应用模块 build.gradle:

dependencies {
        ...
        compile 'com.github.jd-alexander:LikeButton:0.2.3'
    }
}

并在xml中使用它:

<com.like.LikeButton
    app:icon_type="heart"
    app:icon_size="25dp"
    android:id="@+id/heart_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

然后你会得到这样的视图:

【讨论】:

  • 谢谢。它可以达到目的,但我正在寻找不使用图书馆的东西......
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-07-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多