9patch png 如何在 Android 应用程序中工作

发布于 2024-10-09 01:50:30 字数 63 浏览 0 评论 0原文

在 9patch png 中,其四个边都有黑边,但从左到右、从上到下之间通常存在差异。为什么?这种差异有何影响?

In a 9patch png, there are black edges in its four sides, but there is usually difference between the left to right, and the up to down side. Why? How does this difference impact?

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

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

发布评论

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

评论(3

倾听心声的旋律 2024-10-16 01:50:30

最简单的答案之一是 this pic

使用九种修补工具根据您的要求绘制黑线。

One of simplest ans is this pic

draw the black line according to your requirement using nine patch tools.

╰ゝ天使的微笑 2024-10-16 01:50:30

左侧和顶部用于缩放,右侧和底部用于内容。因此,左侧和顶部的黑线将缩放以适合,并且按钮的内容将位于右侧和底部的黑线“内部”。

The left and top are for scaling, and the right and bottom are for content. So the black lines on left and top will scale to fit, and the content for a button will be "inside" the black lines on the right and bottom.

以往的大感动 2024-10-16 01:50:30

这里 http://developer.android.com/guide/ topics/graphics/2d-graphics.html#nine-patch 你可以找到一个很好的解释,有图片显示黑色边框的左侧和顶部部分表示可拉伸部分,而右侧和底部则表示线条定义了可绘制区域,您可以在其中放置内容。

Here http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch you can find a very good explanation, with images to show you that the left and top part of the black border indicate a stretchable section, while the right and bottom lines define the drawable area, where you can put your content.

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