Android - 尝试添加图像时会创建一个空白图像 [英] Android - When attempting to add an image creates a blank image

查看:136
本文介绍了Android - 尝试添加图像时会创建一个空白图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用Android Studios 1.5

I am using Android Studios 1.5

我正在尝试做一些非常简单的事情:添加一个我的项目中的大图像,我将用作MainActivity的背景。当我右键单击res-> Add-> Image Asset并选择Action Bar and Tab Icons并将其指向我的图像时,它会呈现完全空白的矩形,如下所示:

I am attempting to do something very simple: Add a large image to my project that I will be using as the background for my MainActivity. When I right click res->Add->Image Asset and choose "Action Bar and Tab Icons" and point it to my image, it renders completely blank rectangles as seen below:

我做错了什么?我已经阅读了几个不同的页面,没有其他人有这个问题。

What am I doing wrong? I've read several different pages and no one else has had this problem.

推荐答案

好吧我找到了答案。

您无法通过Android Studios界面添加它(为什么我无法理解......)。您需要将项目的根文件夹转到... \app\src\main\res\drawables并将图像复制到所有相应的hdpi,mdpi,xhdpi等文件夹中。然后清理你的项目,它们就会出现。

You can't add it through the Android Studios interface (why is beyond my comprehension..). You need to go to the root folder of your project to ...\app\src\main\res\drawables and copy the image into all of the respective hdpi, mdpi, xhdpi, etc folders. Then clean your project and they will appear.

这篇关于Android - 尝试添加图像时会创建一个空白图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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