안녕하세요.
안드로이드 3.0(허니콤) 부터 화면 하단에 System Bar 라는 것이 생겼지요.
이것을 숨기거나 보이거나 하는 방법이 있기는 한데요.
API Demos 에도있는 데, 희한하게 해당 코드를 가져와서 버전확인해서 호출해도 동작을 하지 않더군요.
안드로이드 3.0 부터 사용가능한 것으로
http://developer.android.com/reference/android/view/View.html#STATUS_BAR_HIDDEN
public static final int STATUS_BAR_HIDDEN
public static final int STATUS_BAR_VISIBLE
public static final int SYSTEM_UI_FLAG_HIDE_NAVIGATION
View has requested that the system navigation be temporarily hidden. This is an even less obtrusive state than that called for by SYSTEM_UI_FLAG_LOW_PROFILE
; on devices that draw essential navigation controls (Home, Back, and the like) on screen, SYSTEM_UI_FLAG_HIDE_NAVIGATION
will cause those to disappear. This is useful (in conjunction with the FLAG_FULLSCREEN
and FLAG_LAYOUT_IN_SCREEN
window flags) for displaying content using every last pixel on the display. There is a limitation: because navigation controls are so important, the least user interaction will cause them to reappear immediately.
See Also
public static final int SYSTEM_UI_FLAG_LOW_PROFILE
View has requested the system UI to enter an unobtrusive "low profile" mode. This is for use in games, book readers, video players, or any other "immersive" application where the usual system chrome is deemed too distracting. In low profile mode, the status bar and/or navigation icons may dim.
See Also
public static final int SYSTEM_UI_FLAG_VISIBLE
View has requested the system UI (status bar) to be visible (the default).
See Also
위와 같은 플레그가 있습니다.
4.0 에서 사용 바뀌었다고 하네요.
아무튼 해당 activity 의 아무 view나
TextView title = (TextView)findViewById(R.id.title);
title.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
이런식으로 호출해 주면 System Bar 가 숨겨 진답니다.
그런데, 코드가 동작하는데 필요한 요소가 하나더 있는데요.
AndroidManifest.xml 에 들어가는
<uses-sdk android:minSdkVersion="11" />
또는
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" />
minSdkVersion 또는 targetSdkVersion 값을 11 이상으로 하고,
title.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
로 하거나 ,
minSdkVersion 또는 targetSdkVersion 값을 14 이상으로 하고,
title.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
으로 해야만 동작을 하더군요.
참고하세요!
위 기능은 잠시. 숨기는 기능으로 알고 있습니다.
또한 숨겨진 바 영역을 사용할수 있는것도 아니구. 그냥 동영상 감상 모드 등에서 쓰라는것 같더군요.
테스트 대상은 갤탭 10.1이었습니다.
다른 경험 있으신분 좀 알려주세요.
ICS부터는 완전히 숨길수도 있습니다. 숨기고 나면 화면전체가 버튼화되어 누르면 다시 원상복구 됩니다. 동영상이나 사진 여러장 슬라이드 시킬 때 시스템바가 거슬릴 수 있기때문에 만든걸로 보입니다.
FULLSCREEN + HIDE_NAVIGATION 을 하면 제 갤럭시 넥서스 에서는 없어지는데 CM9을 올린 갤탭에서 해보니까 안없어지는군요 CM이 아직 알파버전이라서 그런거 같네요
갤럭시 탭2에서 상태바 숨기면.. -_-;;;
백키나 홈키는 어디서...????
결론은 재부팅 ????? =+=''''''''