我使用的是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工作室完成。
雖然我不能創建很多主題..有沒有其他的選擇? –