android 9 补丁drawable xml

发布于 2024-09-08 22:00:40 字数 108 浏览 1 评论 0原文

有没有办法在 android xml 文件中定义 9 patch 可绘制对象?我问的原因是,当您将缩放动画应用于带有笔划的可绘制对象时,笔划看起来会变粗。我想让笔画与动画播放时的大小保持相同......

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拍不死你 2024-09-15 22:00:40

是的,但这主要是为了定义 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>

有关详细信息,请参阅文档

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文