2010-03-28 6 views

Antwort

6

Sie können mit der Probe unter versuchen ...

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

Versuchen Sie folgendes:

Activity.setRequestedOrientation() 

mit diesen Parametern:

ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE 
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT 

prüfen this zur weiteren

+0

Wie drehst du den Bildschirm? im Emulator? – Pentium10

+3

Home und PageUp auf dem Nummernblock, aber stell sicher, dass du zuerst Numlock ausschaltest. –

+0

Strg + F11 auf OSX :) – systempuntoout

Verwandte Themen