小编yan*_*008的帖子

我怎样才能获得android Honeycomb系统的屏幕宽度和高度?

我的代码:

Display display = activity.getWindowManager().getDefaultDisplay();
DisplayMetrics displayMetrics = new DisplayMetrics();
display.getMetrics(displayMetrics);

System.out.println("screen width:"+displayMetrics.widthPixels);
System.out.println("screen heigth:"+displayMetrics.heightPixels);
Run Code Online (Sandbox Code Playgroud)

当我在android Honeycomb系统中运行这个程序时,输出是800和1232,但设备的屏幕是800_1280,我可以得到它吗?谢谢.

height android screen width android-3.0-honeycomb

3
推荐指数
1
解决办法
2969
查看次数

标签 统计

android ×1

android-3.0-honeycomb ×1

height ×1

screen ×1

width ×1