나는 androidActionBar에 필요한 .png 파일 인 styl.xml을 만들었습니다. 난 내 AndroidManifest를로 이동하여style.xml android ActionBar
android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
로 변경하는 경우 지금
<resources>
<style name="Theme.Example" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarItemBackground">@drawable/ab_selectable_background_example</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Example</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Example</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Example</item>
<item name="android:actionDropDownStyle">@style/DropDownNav.Example</item>
<item name="android:actionBarStyle">@style/ActionBar.Solid.Example</item>
<item name="android:actionModeBackground">@drawable/cab_background_top_example</item>
<item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_example</item>
<item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Example</item>
</style>
<style name="ActionBar.Solid.Example" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:background">@drawable/ab_background_textured_example</item>
<item name="android:backgroundStacked">@drawable/ab_stacked_solid_example</item>
<item name="android:backgroundSplit">@drawable/ab_background_textured_example</item>
<item name="android:progressBarStyle">@style/ProgressBar.Example</item>
</style>
<style name="ActionBar.Transparent.Example" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">@drawable/ab_transparent_example</item>
<item name="android:progressBarStyle">@style/ProgressBar.Example</item>
</style>
<style name="PopupMenu.Example" parent="@android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_example</item>
</style>
<style name="DropDownListView.Example" parent="@android:style/Widget.Holo.Light.ListView.DropDown">
<item name="android:listSelector">@drawable/ab_selectable_background_example</item>
</style>
<style name="ActionBarTabStyle.Example" parent="@android:style/Widget.Holo.Light.ActionBar.TabView">
<item name="android:background">@drawable/ab_tab_indicator_ab_example</item>
</style>
<style name="DropDownNav.Example" parent="@android:style/Widget.Holo.Light.Spinner">
<item name="android:background">@drawable/ab_spinner_background_ab_example</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_example</item>
<item name="android:dropDownSelector">@drawable/ab_selectable_background_example</item>
</style>
<style name="ProgressBar.Example" parent="@android:style/Widget.Holo.Light.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/ab_progress_horizontal_example</item>
</style>
<style name="ActionButton.CloseMode.Example" parent="@android:style/Widget.Holo.Light.ActionButton.CloseMode">
<item name="android:background">@drawable/btn_cab_done_default_example</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Example.Widget" parent="@android:style/Theme.Holo">
<item name="android:popupMenuStyle">@style/PopupMenu.Example</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Example</item>
</style>
</resources>
: 시작부터 바로
android:theme="@style/Theme.Example"
내 응용 프로그램 충돌을 여기 는 style.xml입니다 : S 사용할 수 있기 때문에 어떻게 든 AppCompat 테마가 필요합니다.
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
확실하지 않습니다. 어떻게하면 ActionBar에 다른 색과 높이 특성을 부여 할 수 있기 때문에 어떻게 수정 할 수 있을까요?
또는 ActionBar를 제거하고 새 툴바를 사용해야합니까? 나는 새로운 재료 디자인에서 그것 이후로 비록 그것을 사용할 수 있는지 확실하지 않으며 Lolipop 및 더 높은 권리를 위해서만인가? 도움
질문에 충돌 로그를 추가하십시오. – AAnkit
귀하의 logcat 출력은 무엇입니까? –
나는 특정 활동에서만 커스텀 테마를 사용하기 위해 treid했다. 그리고 나서 이것으로 crshes한다 : java.lang.IllegalStateException :이 액티비티와 함께 Theme.AppCompat 테마 (또는 자손)를 사용해야한다. – zooky