Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/222.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在所有设备上缩放android背景图像?_Android_Android Studio_Photoshop - Fatal编程技术网

如何在所有设备上缩放android背景图像?

如何在所有设备上缩放android背景图像?,android,android-studio,photoshop,Android,Android Studio,Photoshop,我目前有一个720x1280像素的图像作为应用程序的背景。我的图像在drawable文件夹中,我正在使用它来缩放它。它在我的Note3上运行得非常好,但是当我在galaxy nexus上尝试它时,它会崩溃很多东西。我得到的错误是“位图太大,无法上传到纹理中。”“我理解这个问题,因为这里已经解释过了 . 我想做以下事情之一: 为每个dpi文件夹创建一个解决方案。我在photoshop中有我的图像作为一个项目,但我不知道如何缩放它。我想找点东西,但找不到 把它放在无dpi文件夹中(就像那个链接所说

我目前有一个720x1280像素的图像作为应用程序的背景。我的图像在drawable文件夹中,我正在使用它来缩放它。它在我的Note3上运行得非常好,但是当我在galaxy nexus上尝试它时,它会崩溃很多东西。我得到的错误是“位图太大,无法上传到纹理中。”“我理解这个问题,因为这里已经解释过了 .

我想做以下事情之一:

  • 为每个dpi文件夹创建一个解决方案。我在photoshop中有我的图像作为一个项目,但我不知道如何缩放它。我想找点东西,但找不到


  • 把它放在无dpi文件夹中(就像那个链接所说的),因为某种原因,这个文件夹不会出现在我的应用程序中。我只有mipmap hdpi/mdpi/xhdpi/xxhdpi。我也发现了这个

  • 编辑:我现在创建了文件夹

    `nodpi - Resources for all densities. These are density-independent resources. The system does not scale resources tagged with this qualifier, regardless of the current screen's density.`
    
    我很乐意接受任何可能解决这个问题的选项,但第二件事可能并不合适,因为它会在旧设备上花费额外的时间

    编辑:


    我尝试了第二种选择,但正如我引用的那样,图像不再缩放。在我的记事本3上,它只占屏幕的1/3。

    “由于某种原因,我的应用程序中没有出现一个文件夹”——你需要自己创建它。有无限多的资源目录;当您创建项目时,它们不会全部存在。@commonware我应该称它为no dpi或mipmap nodpi吗?您应该称它为
    drawable nodpi/
    mipmap-*/
    目录通常仅用于启动程序图标。@Commonware它将在nexus上工作,但不再在note3上缩放