将图像导入 Android Studio,显示为深灰色 [英] Importing image into Android Studio, appears as dark grey

查看:45
本文介绍了将图像导入 Android Studio,显示为深灰色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将图像导入 Android Studio,然后将其用作我的应用程序的背景.我右键单击 res 文件夹并导入资产,接下来我选择操作栏和选项卡图标,在这里我在我的电脑上找到图像文件,然后将其导入到我的项目中.

I am attempting to import an image into Android Studio and then use it as a background for my app. I right click on the res folder and import asset, next I choose action bar and tab icons, here I find the image file on my pc and then import it in my project.

当它导入时,所有的预览都是深灰色的,然后当我把它放在我的布局中时,我得到了这个:

When It imports all the previews are dark grey and then when I place it in my layout I get this:

我使用的是 700kb 左右的 PNG,如果这有什么区别的话.

I am using a PNG which is around 700kb if that makes any difference.

推荐答案

我做了很多事情,但不确定哪一项解决了问题.

I did a variety of things and not sure which one fixed the issue.

首先我意识到我的项目没有使用导致问题的 gradle 包装器,为了解决这个问题,我转到文件->设置并告诉 Intellij 使用默认的 gradle 包装器.

First I realised my project wasn't using the gradle wrapper which was causing issues, to fix this I went to file->settings and told Intellij to use the default gradle wrapper.

然后我安装了 Android Drawable Importer 插件并用它导入了我的图像,现在工作正常.

I then installed the Android Drawable Importer plugin and imported my images with this, works fine now.

这篇关于将图像导入 Android Studio,显示为深灰色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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