Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在drawable文件夹中创建了一个包含大量图片的应用程序,但是将各种大小的图像放入所有drawable文件夹(ldp、mdp、hdp、xhdp、xxhdp)会导致应用程序大小非常大。我只想添加一个图像并根据设备调整其大小,然后将其替换为我的drawable. 我在其他课程中使用图像 ID。
drawable
如何找出设备密度并调整大小和替换drawable文件夹中的图像?
您可以尝试仅使用 drawable-xxhdpi 文件夹。Android 将自行缩放图像。但它会导致更密集的CPU和内存使用。