jac*_*ast 5 android vector shadow drawable
is there a way to create a drop shadow given a drawable with a path like below:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFF"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
Run Code Online (Sandbox Code Playgroud)
xml 和编程方式都很好。我尝试做一些研究,但什么也没找到。
编辑:理想情况下,我需要一些可与任何向量重复使用的东西。就像是:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
//magic happens
</item>
<item>
<include> my_vector </include>
</item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)
再说一遍,即使不是更好,即使以编程方式也没关系
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item >
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#A9A9A9"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
</item>
<item>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="25.0"
android:viewportWidth="25.0">
<path
android:fillColor="#ffffff"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
</item>
Run Code Online (Sandbox Code Playgroud)
请检查此代码。
| 归档时间: |
|
| 查看次数: |
4785 次 |
| 最近记录: |