我使用的是V7程序兼容性库21尝试材质主题行动bar.I使用下面的代码styles.xml如何将不同的动作栏颜色应用于不同的活动?
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MyTheme" parent="Theme.AppCompat">
<item name="windowActionBar">false</item>
<item name="colorPrimary">#3c9cd7</item>
<item name="colorPrimaryDark">#127fba</item>
<item name="colorAccent">#006db0</item>
</style>
</resources>
,我使用布局这个
<android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
在我的应用程序中有很多屏幕与差异背景drawables我想工具栏匹配这些颜色。我不想使用颜色标志。 这可以使用xml文件来完成吗? 我试着改变android:background,它可以工作,但通知栏的颜色不会随着它变化。
这一切都在Xamarin工作室完成。
虽然我不能创建很多主题..有没有其他的选择? –