[問題] 拿螢幕長寬
在sdk level 11 之前的device
DisplayMetrics metrics = new DisplayMetrics();
this.getWindowManager().getDefaultDisplay().getMetrics(metrics);
screenWidth = metrics.widthPixels;
screenHeight = metrics.heightPixels;
可以正確地獲得螢幕長寬
但是到了 level 11 以上時就會 retrun 非實際的長度給我
像是 Nexus7 正確長度為1280,但是用了上面的程式會回傳1205 (portrait時)
有什麼 method 是可以獲得正確的長度也能向下支援到 level 8?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.45.229.76
→
01/16 00:59, , 1F
01/16 00:59, 1F
→
01/16 02:04, , 2F
01/16 02:04, 2F
→
01/16 16:56, , 3F
01/16 16:56, 3F
→
01/16 16:57, , 4F
01/16 16:57, 4F
→
01/16 16:58, , 5F
01/16 16:58, 5F