2010-03-28 8 views

답변

6

당신은 아래의 샘플을 시도 할 수 있습니다 ...

if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { 
    // You can set the value initially by 
    // ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED. Once set it 
    // retains it's value. The View will be rendered in the specified 
    // orientation using the code below. 
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 
} 
10

이 시도 :

Activity.setRequestedOrientation() 

이러한 매개 변수 :

ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE 
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT 

확인 this를 더 참조

+0

화면을 어떻게 회전합니까? 에뮬레이터에서? – Pentium10

+3

홈 및 PageUp을 숫자 패드로 입력해야하지만 먼저 numlock을 해제해야합니다. –

+0

OSX에서 Ctrl + F11 :) – systempuntoout

관련 문제