2013-04-23 2 views
3

라이브 벽지에서 세로 모드로 화면을 잠글 수 있습니까? 그렇다면 어떻게?라이브 배경 화면을 세로 모드로 잠글 수 있습니까?

내가 SO에이 질문에 두 가정 답변을 보았다 언급해야이 하나가 지나치게 복잡 나타났다 , 나는 모든 것을 이해하지 못했다과 대답은 원래 포스터에 의해 받아 들여지지 않았다. 두 번째 대답은 나를 위해 작동하지 않았다.

의 사용과 관련된 세 번째 답 :

android:screenOrientatin = "portrait" or "landscape" 

이 제안되었지만,이 매니페스트에 가야 정확한 위치는 명확하지 않다.

EDIT : 매니 페스트의 많은 다른 위치에 android : screenOrientation = "portrait"을 넣으려고 시도했지만 그 중 아무 것도 작동하지 않았습니다.

편집 : 다른 답변은 비트 맵을 회전 단지 옆으로 모든 것을 그려 회전을 처리했다 -하지만 당신은 당신에게 전화를 회전로, OS가 회전 애니메이션을 선동, 때문에 매우 추한 외모 - 당신이 얻을 것을 의미합니다 당신이 전화를 켜면 무시 무시한 점프 효과.

+0

[응용 프로그램이 열릴와 방향이 변경 방지 라이브 배경 화면 방향 변경?]의 중복 가능성 (http://stackoverflow.com/questions/4372936/prevent-live-wallpaper-orientation 사용할 수 있습니다 -change-when-an-application-is-open-and-orie) –

+0

대답이 명확하고 B) 작동하기 전에이 질문을 닫지 마십시오. – Mick

+0

http://stackoverflow.com/questions/14587085/how-can-i-globally-force-screen-orientation-in-android](http://stackoverflow [: 보이지 않는 뷰를 생성하고 나에게 잘 작동/질문/14587085 방법 --I-세계적으로 힘 화면 지향 -에 - 안드로이드 수 – Matthew

답변

2

수정해야하는지 추측 할 수있다.

0

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);을 시도 했습니까? 에서

+0

setRequestedOrientation가 나타납니다)는 아마도 당신이 활동 같은 것을 구현해야 WallpaperService – Mick

+0

에 대한 정의되지 않은 수/.COM? – Leo

0

당신의 AndroidManifest.xml이 같은 있어야한다 : 이것은 당신의 활동 세로 모드에서 실행 있는지 확인해야합니다

<application 
    android:icon="@drawable/app_icon" 
    android:label="@string/nuboLogin" 
    android:name=".LoginApplication" 
    android:debuggable="true"> 
    <activity 
     android:name=".WallPaperActivity" 
     android:label="@string/wallPaper" 
     android:windowSoftInputMode="adjustPan" 
     android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:screenOrientation="portrait" 
     android:configChanges="orientation|keyboardHidden"> 
    </activity> 

합니다. 당신이 풍경을 선호하는 경우, 당신은 쉽게 당신은 내가 진정한 대답은 "아니오"단순히 의심하기 시작하고있어

+0

wallpapr은 활동이 아닌 "서비스"입니다.하지만 어쨌든 android : screenOrientation = "portrait"을 추가하려고 시도했지만 효과가 없습니다 .--( – Mick

0

Android 응용 프로그램은 방향이 변경 될 때 활동을 다시 시작합니다. 당신도

android:configChanges in your manifest. The activity is shut down and restarted by default, when a configuration change occurs at runtime, but declaring a configuration with this attribute will prevent the activity from being restarted. Instead, the activity remains running and its onConfigurationChanged() method is called. 
use android:screenOrientatin = "portrait" or "landscape" it will force the app to run in the mode you specify. However it will not prevent the activity from being shut down and restarted. 
관련 문제