为什么 Eclipse/device 中的 .9.png 与 draw9patch.exe 中的不一样?

发布于 2025-01-04 19:04:08 字数 671 浏览 3 评论 0原文

我在draw9patch.exe中创建combobox_normal_m.9.png。在draw9patch.exe 中看起来非常好,但在Eclipse/device 中则不太清楚。为什么边缘模糊?

来自布局:

<Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/selector_cbutton_m" />

来自选择器:

<item 
    android:drawable="@drawable/combobox_normal_m"
    android:state_selected="false"
    android:state_pressed="false"/>

在此处输入图像描述在此处输入图像描述

I create combobox_normal_m.9.png in draw9patch.exe. It looks very good in draw9patch.exe, but in Eclipse/device it's not so clear. Why edges are blurred?

from layout:

<Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/selector_cbutton_m" />

from selector:

<item 
    android:drawable="@drawable/combobox_normal_m"
    android:state_selected="false"
    android:state_pressed="false"/>

enter image description hereenter image description here

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

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

发布评论

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

评论(1

孤独陪着我 2025-01-11 19:04:08

您已经颠倒了顶部和底部 9 个补丁数据。顶部 1 个像素定义了可以拉伸的区域。底部 1 个像素定义了可以被内容覆盖的区域。我猜,除非您打算在文本的右边缘和垂直分隔符之间有一个缓冲区。我可能会误解你想要做什么。

您还会注意到,如果您想要在不同的像素密度下查看不可扩展的功能,您仍然需要为不同的密度创建 9 补丁的版本。在 Eclipse 中,您还会看到屏幕分辨率的放大(通常)版本,因此它可能不能代表设备。

You've inverted the top and bottom 9 patch data. The top 1 pixel defines the area that can be stretched. The bottom 1 pixel defines the area that can be covered with content. Unless, I guess, you intended there to be a buffer between the right edge of the text and the vertical separator. I could be misunderstanding what you are trying to do.

You will also notice that you still have to create versions of the 9 patch for different densities if there are non-scalable features that you want to look right at the different pixel densities. In eclipse you are also seeing a enlarged (typically) version of the screen resolution so it may not be representative of the device.

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