티스토리 뷰

Mobile/Android

[Android]Custom Actionbar Theme Example

out of coding 2014. 9. 16. 10:57

Actionbar를 CustomView말고 그냥 Theme만 변경하여서 사용이 가능하다.

아주 쉽고 간단하고 편하다.


<resources xmlns:tools="http://schemas.android.com/tools">
	<!-- App Theme For Actionbar -->
	<style name="MyActionBarTheme" parent="@style/Theme.AppCompat.Light">
		<item name="actionBarStyle">@style/MyActionBar</item>
		<item name="android:actionBarStyle" tools:targetApi="11">@style/MyActionBar</item>
		<item name="actionBarTabTextStyle">@style/MyActionBarTabText</item>
		<item name="android:actionBarTabTextStyle" tools:targetApi="11">@style/MyActionBarTabText</item>
	</style>
	<!-- Actionbar Theme -->
	<style name="MyActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid">
		<item name="android:background">@android:color/darker_gray</item>
		<item name="background">@android:color/darker_gray</item>
		<item name="titleTextStyle">@style/MyActionBarTitleText</item>
		<item name="android:titleTextStyle" tools:targetApi="11">@style/MyActionBarTitleText</item>
	</style>
	<!-- Actionbar Title Theme -->
	<style name="MyActionBarTitleText" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
		<item name="android:textColor">#ffffff</item>
	</style>
	<!-- Actionbar Tab Theme -->
	<style name="MyActionBarTabText" parent="@style/Widget.AppCompat.Light.ActionBar.TabText">
		<item name="android:textSize">15sp</item>
	</style>
</resources>

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2025/01   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함