HTC感觉实际分辨率 [英] HTC Sensation Real Resolution
本文介绍了HTC感觉实际分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个方法来得到真正的解决方案:
I have two approaches to get real resolution:
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
device_value[index++] = dm.widthPixels + "x" + m.heightPixels;
Display display = getWindowManager().getDefaultDisplay();
String widthAndHeight = display.getWidth() + " x " + display.getHeight();
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="3"/>
<supports-screens android:anyDensity="false" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true"/>
它们都返回320x569,而真正的是640×960。
Both of them return "320x569" while the real one is "640x960".
推荐答案
结论如何获得真正的解决方案:
Conclusion about how to get real resolution:
< uses-sdk android:targetSdkVersion="4"...
< supports-screens android:anyDensity="true"...
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
String resolution = dm.widthPixels + "x" + m.heightPixels;
这篇关于HTC感觉实际分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文