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.
我正在尝试在我的应用程序中绘制一个矩形视图,但它在具有不同屏幕分辨率的不同设备中看起来不同。任何想法如何在所有不同的分辨率设计中绘制相同大小的视图。提前致谢。
从文档(支持多种屏幕尺寸):
将您的尺寸乘以scale
scale
// Get the screen's density scale final float scale = getResources().getDisplayMetrics().density;