안드로이드 컬러 포지션
필그램
·2019. 1. 30. 00:52
안드로이드의 컬러 포지션
1) AndroidManifest.xml and see the tag, the android theme is mentioned as:-- android:theme="@style/AppTheme"
2) pen the Styles.xml and we have base application theme declared there:--
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
</style>
3) ActionBar with different color background:--
To do this we need to create a new style MyActionBar(you can give any name) with a parent reference to @style/Widget.AppCompat.Light.ActionBar.Solid.Inverse that holds the style characteristics for the Android ActionBar UI element. So definition would be
<style name="MyActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">@color/red</item>
</style>
res/values/styles.xml file of your Android project.
<resources>
<!-- 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>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="FullscreenTheme" parent="AppTheme">
<item name="android:actionBarStyle">@style/FullscreenActionBarStyle</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowBackground">@null</item>
<item name="metaButtonBarStyle">?android:attr/buttonBarStyle</item>
<item name="metaButtonBarButtonStyle">?android:attr/buttonBarButtonStyle</item>
</style>
<style name="FullscreenActionBarStyle" parent="Widget.AppCompat.ActionBar">
<item name="android:background">@color/black_overlay</item>
</style>
</resources>
Then set "MyCustomTheme" as the Theme of your Activity that contains the ActionBar.
'프로그래밍 > 모바일: iOS, Java, Android, Swift' 카테고리의 다른 글
안드로이드 FCM 푸시알림 [열코의 프로그래밍 일기] (0) | 2019.03.27 |
---|---|
[안드로이드 스튜디오] 웹뷰에서 자바스크립트 가능하게 (0) | 2019.03.21 |
안드로이드의 버튼 링크 (0) | 2019.01.28 |
[Android] 라디오 버튼 선택 및 Switch조건문으로 실행법 (0) | 2017.10.21 |
[Java] 사용자 입력 받는 방법 (0) | 2017.10.21 |