안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요
상태바를 아래/위로 드래그하면 에니메이션되면서 뷰가 확장되는데요
사람손으로 하지 않고
소스코드로 올렸다가 내렸다가 컨트롤이 가능한가요?
검색을 해도 상태바 자체를 감추거나 보이게 하거나하는것만 나오네요 ㅠ.ㅜ
2012.10.17 10:11:33
기능은 구현되어 있는 것으로 알지만, @hide 로되어 있어서, 사용 할 수 있는지는 정확하게 모르겠네요.
/**
* Allows an app to control the status bar.
*
* @hide
*/
public class StatusBarManager
public void expand() {
try {
final IStatusBarService svc = getService();
if (svc != null) {
svc.expand();
}
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
}
}
/**
* Collapse the status bar.
*/
public void collapse() {
try {
final IStatusBarService svc = getService();
if (svc != null) {
svc.collapse();
}
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
}
}
그리고 퍼미션이 필요해요.
Manifest.permission.EXPAND_STATUS_BAR
없는걸로 아는데...