android:9补丁图像具有透明边框作为图像的一部分

发布于 2025-01-03 21:21:08 字数 300 浏览 3 评论 0原文

9 块图像应在进行 9 块标记的地方具有透明边框: http://developer.android.com/guide/developing/tools/draw9patch.html

但我有 9 块图像,其中有 4 个像素以上作为图像的一部分。我已将它们标记为不相当大的部分,但它们完全被忽略,并且仅显示不透明的像素。

如何将透明图像像素标记为图像部分?

9-patch images should have transparent border where 9-patch markup is made:
http://developer.android.com/guide/developing/tools/draw9patch.html

But i have 9-patch image with 4 pixels more as a part of the image. I've marked them as not sizeable parts, but they are totally ignored and only not transparent pixels are displayed.

How can i mark transparent image pixels as an image part?

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

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

发布评论

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

评论(2

梦回旧景 2025-01-10 21:21:08

你好,

尝试这样:

<ImageButton
    android:id="@+id/imgButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/refresh_icon"
    android:background="@drawable/background_image">

资源:

refresh_icon

background_image

Hi,

Try like this:

<ImageButton
    android:id="@+id/imgButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/refresh_icon"
    android:background="@drawable/background_image">

Resources:

refresh_icon

background_image

恋你朝朝暮暮 2025-01-10 21:21:08

你在android sdk中使用draw9patch吗?我正在使用draw9patch,当我用photoshop制作一个包含我想要的透明像素数量的图像时,然后用draw9patch打开图像,我可以看到9patch像素的位置是图像的边缘,它是透明像素的外部位置。

Are you using draw9patch in android sdk? I'm using draw9patch, when I make an image with photoshop including transparent pixels with amount of which I want, then the image opend with draw9patch, I can see the position of 9patch pixel is edge of the image which is outer position with transparent pixels.

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