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.
如何在 Android 中获取应用程序图标的特定密度(hdpi、xhdpi 等)的(int)资源 ID?
我知道我们可以使用 getDrawableForDensity() 方法获取特定密度的可绘制对象,但是如何获取此可绘制对象的资源 ID?
Android 不需要您这样做。添加资源后,将自动引用每个设备密度。但是,您应该在必要时使用矢量可绘制对象。