您的位置: 首页> 移动开发> Android三种方式生成矢量图之5ectorDrawable类使用详解

Android三种方式生成矢量图之5ectorDrawable类使用详解

时间:2023-04-27 14:29:44 来源:互联网

生成矢量图VectorDrawable的三种方式

选中drawable文件夹,右键New --> Vector Asset --> 选中Clip Art ,在这里面可以选择一些矢量图 ,点击Next,然后 Finish即可。

选中drawable文件夹,右键New --> Vector Asset --> 选中Local file ,在这里面选择自己svg路径 ,点击Next,然后 Finish即可。

自己编写代码

静态VectorDrawable的使用

配置引用和参数

gradle文件种按下面配置:

android {
    defaultConfig {
        ...
        vectorDrawables.useSupportLibrary = true
    }

  ...

dependencies {
   ...

    implementation 'com.android.support:appcompat-v7:23.4.0'
}

注意:support:appcompat 必须在23.2

上一篇:Android动态使用5ectorDrawable过程详解 下一篇:kotlin实现快递与号码归属地查询案例详解

相关文章

相关应用

最近更新