android获得屏幕的大小
2837 点击·0 回帖
![]() | ![]() | |
![]() | final Display display = this.getWindow().getWindowManager().getDefaultDisplay(); if (display != null) { // 获取屏幕大小 screenWidth = display.getWidth(); screenHeight = display.getHeight(); } final Display display = this.getWindow().getWindowManager().getDefaultDisplay(); if (display != null) { // 获取屏幕大小 screenWidth = display.getWidth(); screenHeight = display.getHeight(); } 摘自 知识空间 | |
![]() | ![]() |