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.
感谢您的帮助,并对愚蠢的问题感到抱歉...
好的,我有一个显示不同图像的画廊(我使用 setImageResource(resId),图像是 /drawables 中的 jpgs)。
这些图像有不同的尺寸,我想让它们都缩放到相同的固定高度。
谢谢。
首先将所有图像转换为 .png 文件,因为 android 使用 png 图像工作 gr8 然后将其作为
drawable-hdpi drawable-ldpi drawable-mdpi drawable-xhdpi drawable-xxhdpi
您将图像从 /res 目录中放置为
drawable-hdpi drawable-mdpi drawable-ldpi drawable-xhdpi