V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  xiaohui312  ›  全部回复第 1 页 / 共 1 页
回复总数  2
2015-08-12 09:21:31 +08:00
回复了 xiaobetty 创建的主题 推广 晒出你最蠢的一段代码,送 Cherry 鼠标垫
大鼠标垫已经收到,超赞!100ofer威武霸气
2015-08-05 12:07:01 +08:00
回复了 xiaobetty 创建的主题 推广 晒出你最蠢的一段代码,送 Cherry 鼠标垫
/** 获取设备宽度和高度 **/
public static int[] getDeviceWH(Context paramContext) {
int[] arrayOfInt = new int[2];
DisplayMetrics localDisplayMetrics = new DisplayMetrics();
((WindowManager) paramContext.getSystemService("window")).getDefaultDisplay().getMetrics(localDisplayMetrics);
int i = localDisplayMetrics.widthPixels;
int j = localDisplayMetrics.heightPixels;
arrayOfInt[0] = i;
arrayOfInt[1] = j;
return arrayOfInt;
}
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3506 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 04:41 · PVG 12:41 · LAX 21:41 · JFK 00:41
Developed with CodeLauncher
♥ Do have faith in what you're doing.