问题描述
我直接将一些图像保存到了可绘制的文件夹中.这些,Android Studio可以正常识别.但是,代码无法识别保存在mhdpi,hdpi,xhdpi,xxhdpi和xxxhdpi文件夹中的图像,并显示错误.有人知道发生了什么吗?谢谢!
I saved some images directly to the drawable folder. These, Android Studio recognizes normally. But the images saved in the mhdpi, hdpi, xhdpi, xxhdpi and xxxhdpi folders the code does not recognize and shows an error. Does anyone know what's going on? Thanks!
推荐答案
在右键单击res文件夹和名称文件夹后,尝试创建新的可绘制文件夹来放置图像
Try making new drawable folders for putting images after right clicking res folder and name folders like this
drawable-hdpi
drawable-hdpi
drawable-mdpi
drawable-mdpi
drawable-xhdpi
drawable-xhdpi
drawable-xxhdpi
drawable-xxhdpi
drawable-xxxhdpi
drawable-xxxhdpi
根据其尺寸拖放具有相同名称的图像.android将drawable文件夹作为一个实体,拾取最适合的图像并将其显示在不同分辨率的手机上.
Drag and drop image with same name according to their dimensions. The android takes drawable folder as one entity, picks up the best suited image and shows it on different resolution phones.
这篇关于Android Studio无法识别hdpi文件夹中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!