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.
见下图
检查此链接 但我没有得到 CoreSystemContext.SCALE 。现在我收到错误
请帮我 ...
这段代码的原作者在评论中回复了这个问题:
那是保持设备密度的变量。
所以只需使用这个:
float density = getResources().getDisplayMetrics().density; int extraTapArea = (int) (13 * density + 0.5);