android 9补丁drawable xml

时间:2010-07-07 22:24:53

标签: android xml drawable nine-patch

有没有办法在android xml文件中定义9个补丁drawable?我问的原因是,当你将一个缩放动画应用到一个可绘制的笔画上时,笔画看起来会变粗。我想让笔画保持与动画播放相同的大小...

1 个答案:

答案 0 :(得分:17)

是的,但这主要是为了定义9补丁的抖动。 这是一个例子:

<?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>

有关详细信息,请参阅the documentation

相关问题