Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android 9 patch drawable xml

Is there a way to define a 9 patch drawable in an android xml file? The reason I ask, is that when you apply a scale animation to a drawable w/ a stroke on it, the stroke appears to thicken. I'd like to make the stroke stay the same size as the animation plays...

like image 670
Ben Avatar asked Jul 07 '10 22:07

Ben


1 Answers

Yes, but this is done mostly to define dithering for the 9-patch. Here's an example:

<?xml version="1.0" encoding="utf-8"?>
<nine-patch
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:src="@drawable/your_drawable_here"
        android:dither="true"
        >
</nine-patch>

For more information see the documentation

like image 127
Lior Avatar answered Oct 11 '22 20:10

Lior