안드로이드 스크린 화면 크기 구하기 :: 소림사의 홍반장!

안드로이드 스크린 화면 크기 구하기

2012. 5. 20. 14:16 - 삘쏘굿
스크린 크기 구하기

Display display = ((WindowManager)getSystemService(WINDOW_SERVICE)).getDefaultDisplay(); int displayWidth = display.getWidth(); int displayHeight = display.getHeight();

 


public class

Display

java.lang.Object
   ↳android.view.Display

Class Overview

Provides information about the display size and density.

Summary

Constants
intDEFAULT_DISPLAYThe default Display id.
Public Methods
intgetDisplayId()
Returns the index of this display.
intgetHeight()
This method is deprecated. Use getSize(Point) instead.
voidgetMetrics(DisplayMetrics outMetrics)
Gets display metrics that describe the size and density of this display.
intgetOrientation()
This method is deprecated. use getRotation()
intgetPixelFormat()
Return the native pixel format of the display.
voidgetRectSize(Rect outSize)
Gets the size of the display as a rectangle, in pixels.
floatgetRefreshRate()
Return the refresh rate of this display in frames per second.
intgetRotation()
Returns the rotation of the screen from its "natural" orientation.
voidgetSize(Point outSize)
Gets the size of the display, in pixels.
intgetWidth()
This method is deprecated. Use getSize(Point) instead.

다른 카테고리의 글 목록

Dev. 안드로이드/참고소스 카테고리의 포스트를 톺아봅니다