[ 안드로이드 action bar, title bar 없애기 ]
오늘은 안드로이드 액션 바, 타이틀 바를 없애는 법에 대해서 알려 드리려 합니다. 안드로이드 네이티브 앱을 만들때는 잘 쓰지 않지만 요새 하이브리드 앱을 만들 때 고객사의 요청으로인해 액션 바, 타이틀 바를 없애 달라는 곳이 있어 공유 드립니다.
1. res -> values -> styles.xml 파일을 열어 줍니다. 현재 기본 styles는 windowNoTitle, android:windowFullscreen이 없습니다.
colorAccent 밑에 windowNoTitle, android:windowFullscreen 를 추가 해주시면 action bar와 title bar를 숨김 처리 해줄 수 있습니다.
1 2 3 4 5 6 7 8 9 10 | <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="windowNoTitle">true</item> <!-- 타이블 바 없애기 시계 밑에있는게 타이틀 바입니다. --> <item name="android:windowFullscreen">true</item> <!-- 풀 스크린으로 만들어 액션바 hide --> </style> | cs |
이상입니다. 짧지만 유용 하셨다면 좋아요 한번씩 눌러 주시면 저에게 큰 힘이 됩니다.
감사합니다.
[Android] 앱버전과 플레이스토어 버전 비교(업데이트) (11) | 2019.02.27 |
---|---|
[안드로이드] 하이브리드 앱 만들기(hybrid) (1) | 2019.01.28 |
[안드로이드] 자바스크립트 연동(자바스크립트 브릿지) (0) | 2018.12.18 |
안드로이드 webview shouldOverrideUrlLoading() 사용법 (1) | 2018.10.04 |
[Android] 뒤로가기(Back) 버튼 막기 (0) | 2018.08.17 |