【发布时间】:2011-11-02 22:51:10
【问题描述】:
我正在编写一款我想在中高密度(320x480 和 480x800)上运行的游戏。为了在两种密度下运行应用程序,我必须像这样设置 support-screens 参数。-
<supports-screens android:anyDensity="true" />
我的问题是,在某些第 2 代设备(即 HTC Desire)中,游戏以高清密度运行,但性能有点差,所以我试图为这些设备“强制”中等密度。
我设法得到这样的电流密度。-
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
DisplayMetrics 类似乎有一个“setTo”方法,但不确定它是否符合我的需要,也不知道我应该如何使用它。有什么方法可以实现吗?
谢谢!
【问题讨论】:
标签: android