将图像导入Android Studio中,显示为深灰色 [英] Importing image into Android Studio, appears as dark grey
问题描述
我正在尝试将图像导入Android Studio,然后将其用作我的应用程序的背景.我右键单击res文件夹并导入资产,然后选择操作栏和选项卡图标,在这里我在PC上找到了图像文件,然后将其导入到我的项目中.
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包装器,要解决此问题,我去了file-> settings,并告诉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屋!