错误:Android Studio 中必须有透明或白色的一像素框架 [英] Error:Must have one-pixel frame that is either transparent or white in Android Studio

查看:32
本文介绍了错误:Android Studio 中必须有透明或白色的一像素框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将一个项目从 Eclipse 导入到 Android Studio.几乎每隔一秒,android studio 就会出现以下错误.

I have just imported a project from eclipse to Android studio. Almost for every second image , android studio is giving the following error.

Error:Must have one-pixel frame that is either transparent or white.

我在过去几个小时内试图编辑我的图像,但无法做到.任何人都可以指导我什么是最好的解决方案.

I am trying to edit my images for last few hours, but couldn't do it. Can anyone guide me whats the best solution for it.

为什么它只在 Android Studio 中,为什么不在 Eclipse 中.

Why its in only Android Studio why not in Eclipse.

推荐答案

出现此问题是因为您正在尝试编辑没有适当 1 像素边框的 9-Patch 图像.

This is shown because you're trying to edit 9-Patch images that don't have the appropriate 1-pixel border.

Android 使用一种称为 9-Patch 的图像格式,它允许您在图像中定义可拉伸区域(您可以阅读有关它的更多信息 此处).要解决您的问题,请向您的 png 图像添加一个 1 像素厚的外部透明框架,或者只需将它们从 .9.png 文件重命名为 .png 文件

Android uses an image format called 9-Patch which allows you to define stretchable areas in an image (you can read more about it here). To fix your problem, either add an outer 1-pixel thick transparent frame to your png images or simply rename them from .9.png files to .png files

这篇关于错误:Android Studio 中必须有透明或白色的一像素框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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