Android AppCompat,正在尝试在7.21版中设置tabbar的样式
我尝试使用以下代码设置选项卡栏的样式:Android AppCompat,正在尝试在7.21版中设置tabbar的样式,android,android-theme,android-appcompat,Android,Android Theme,Android Appcompat,我尝试使用以下代码设置选项卡栏的样式: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="MyTheme" parent="MyTheme.Base"/> <style name="MyTheme.Base" parent="Theme.AppCompat"> <item name="colorPrimary">@color/
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyTheme" parent="MyTheme.Base"/>
<style name="MyTheme.Base" parent="Theme.AppCompat">
<item name="colorPrimary">@color/palette_1</item>
<item name="colorPrimaryDark">@color/palette_5</item>
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">true</item>
<item name="android:windowBackground">@color/palette_1</item>
<item name="android:actionBarStyle">@style/MyTheme.ActionBar</item>
<item name="actionBarStyle">@style/MyTheme.ActionBar</item>
<item name="actionBarTabStyle">@style/MyTheme.ActionBarTabBar</item>
<item name="android:actionBarTabStyle">@style/MyTheme.ActionBarTabBar</item>
</style>
<style name="MyTheme.ActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">@color/palette_5</item>
<item name="backgroundStacked">@color/palette_5</item>
<item name="backgroundSplit">@color/palette_5</item>
</style>
<style name="MyTheme.ActionBarTabBar" parent="@style/Widget.AppCompat.ActionBar.TabView">
<item name="android:background">@color/palette_5</item>
</style>
<style name="MyTheme.NoTitleBar" parent="MyTheme">
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
</style>
</resources>
@颜色/调色板\u 1
@颜色/调色板_5
符合事实的
符合事实的
@颜色/调色板\u 1
@style/mysteme.ActionBar
@style/mysteme.ActionBar
@style/Mysteme.ActionBartabar
@style/Mysteme.ActionBartabar
@颜色/调色板_5
@颜色/调色板_5
@颜色/调色板_5
@颜色/调色板_5
符合事实的
错误的
例如,当调色板_1为绿色,调色板_5为蓝色时。
操作栏是蓝色的,但选项卡栏保持我在android:windowBackground中定义的颜色,即绿色
这是我在搜索了大量主题后得出的代码。但它似乎在某些地方存在冲突。操作栏导航模式已被弃用,内联工具栏操作栏不支持这些模式。你应该考虑使用不同的模式: