9补丁图像,其中中心为1:1 [英] 9 Patch image where center is 1:1

查看:167
本文介绍了9补丁图像,其中中心为1:1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在中间建立在Android闪屏的小标志, 但标志streched的大型设备。我以为我可以使用9片图像,但它似乎是一个9片图像作品倒什么,我试图达成。

I want to create a splash screen on Android with a small logo in the middle, but the logo is streched on larger devices. I thought I could use a 9 patch image, but it seems a 9 patch image works inversed to what I try to reach.

这是具有要在中间的标志

This is the logo that has to be in the middle.

这是我所得到的,当我设置图片为9补丁。 该中心伸出和拐角都完好无损。 我需要相反的。 我需要一个9补丁可以定义始终显示在正确1的中心区域:1的比例,并在左侧边,右侧,顶部和底部可如果图像是小于屏幕拉伸

This is what I get when I set the image as a 9 patch. The center is stretched out and the corners are intact. I need to opposite. I need a 9 patch that can define a center area that is always displayed in correct 1:1 proportion, and border areas at left, right, top and bottom that can be stretched if the image is smaller than the screen.

我怎样才能做到这一点?带或不带9的补丁。

How can I do this? With or without 9 patch.

推荐答案

下面是你如何能做到这样的一个例子。这是一个9patch,所以保存它是这样的:yourname.9.png不要忘记设置机器人:您 > ImageView的

Here is an example of how you can do this. This is a 9patch, so save it like this: yourname.9.png and don't forget to set android:scaleType="fitXY" on your ImageView

这篇关于9补丁图像,其中中心为1:1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆