Ich habe den Beitrag gelesen, um das customNavigationLayout für das Holo-Thema festzulegen. Gibt es eine ähnliche Sache für appcompat (Theme.AppCompat.Light.DarkActionBar)?
<style name="Theme.Main" parent="android:Theme.Holo.Light">
<item name="android:actionBarStyle">@style/Widget.ActionBar</item>
</style>
<style name="Widget.ActionBar" parent="android:Widget.Holo.Light.ActionBar">
<item name="android:displayOptions">showHome|useLogo|showCustom</item>
<item name="android:customNavigationLayout">@layout/custom</item>
</style>
Antworten:
0 für die Antwort № 1Versuche dies:
<style name="Theme.Main" parent="@style/Theme.AppCompat.Light">
<item name="android:actionBarStyle">@style/Widget.ActionBar</item>
</style>
<style name="Widget.ActionBar" parent="@style/Widget.AppCompat.Light.ActionBar">
<item name="android:displayOptions">showHome|useLogo|showCustom</item>
<item name="android:customNavigationLayout">@layout/custom</item>
</style>
-1 für die Antwort № 2
Sie können es im Android-Manifest festlegen
AndroidManifest.xml:
<activity android:name="com.example.Activity1"
android:theme="@style/CustomActionBarTheme"
/>