4
android : screenOrientation = "portrait"는 젤리 해에서 무시됩니다. 전화를 가로로 돌리면 방향에 관계없이 방향이 바뀝니다. 여러 대의 휴대폰을 사용해 보았습니다. 내가 사용해야하는 새 깃발이 있습니까?젤리 빈에서는 android : screenOrientation = "portrait"가 무시됩니다.
android : screenOrientation = "portrait"는 젤리 해에서 무시됩니다. 전화를 가로로 돌리면 방향에 관계없이 방향이 바뀝니다. 여러 대의 휴대폰을 사용해 보았습니다. 내가 사용해야하는 새 깃발이 있습니까?젤리 빈에서는 android : screenOrientation = "portrait"가 무시됩니다.
당신은 프로그래밍을 수행하려고 할 수 있으며, 코드
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
switch (newConfig.orientation)
{
case Configuration.ORIENTATION_PORTRAIT:
// taking action on event
lockScreenRotation(Configuration.ORIENTATION_PORTRAIT);
break;
case Configuration.ORIENTATION_LANDSCAPE:
// taking action on event
lockScreenRotation(Configuration.ORIENTATION_LANDSCAPE);
break;
case Configuration.ORIENTATION_SQUARE:
// taking action on event
lockScreenRotation(Configuration.ORIENTATION_SQUARE);
break;
default:
throw new Exception("Unexpected orientation!!!");
break;
}
private void lockScreenRotation(int orientation)
{
// Stop the screen orientation changing during an event
switch (orientation)
{
...
case Configuration.ORIENTATION_PORTRAIT:
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
break;
case Configuration.ORIENTATION_LANDSCAPE:
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
break;
...
case default:
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
break;
}
}
감사합니다, 최대한 빨리 그것을 밖으로 시도 할 것이다. 도대체 뭐가 틀린 지 구글 그룹에게 물어볼 것이다. –