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.
我有一个应用程序,我在其中设置图像视图的背景。如果我将图像保存在 re/drawable(s) 文件夹中,一切正常,但如果我将相同的图像保存在 sdcard 中并从那里加载以设置背景,那么图像的尺寸就会不同。
之前有人问过类似的问题,但仍然没有答案。任何人都可以对这个话题有所了解。
如果我们将图像放在 res/drawable(s) 文件夹中,那么 android 会根据目标设备选择合适的图像,并且如果需要,系统也会进行缩放。因此,如果您将图像放入 sdcard 中,则系统不会对图像进行任何缩放。