IT/Android

diplay.getOrientation

bestrok 2011. 10. 27. 14:44

1. 윈도메니저를 통해 현재 화면이 landscape 인지 portrait 인지 확인할 수 있다.


##########################################################################

int mOrientation = getWindowManager().getDefaultDisplay().getOrientation(); 

##########################################################################


화면은 반시계방향으로 0,1,2,3 으로 로테이션 된다.


각도반환값참고
0 0 가로
-90 1 세로
-180 2 가로
-270 3 세로