How can we tile a vector image?

后端 未结 5 716
眼角桃花
眼角桃花 2021-02-12 21:02

With the support library now fully supporting vector images, I\'m trying to switch to vector images as much as I can in my app. An issue I\'m running into is that it seems impos

5条回答
  •  忘了有多久
    2021-02-12 21:19

    I see 2 easy workarounds to this problem:

    1. To create (repeat) pattern you want in SVG manipulative software like 'Inkscape' or 'CorelDraw'. And then use this 'created_manually_pattern_svg' in your 'ImageView' as

    ... 
    app:srcCompat="@drawable/created_manually_pattern_svg"
    ...
    

    or even

    ...
    android:background="@drawable/created_manually_pattern_svg"
    ...
    

    in any ather 'view' (but i'm not sure if it works in all API levels)

    2. Export your '.svg' file into '.png' and then use 'bitmap'.

提交回复
热议问题