0
我试图改变动作条的颜色在我的“AppBar布局”程序,通过这个代码:改变“动作条”色不给正确的颜色
toolbar.setBackgroundColor(R.color.hidden_bars); //#464445
但每次我用不同颜色的结束,在colorPrimary(#48bee6)
这里更暗的版本是我的xml:
<android.support.design.widget.AppBarLayout
android:id="@+id/id_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="enterAlwaysCollapsed" />
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
style="@style/WenoTabLayout"
android:layout_width="match_parent"
android:layout_height="@dimen/tab_bar_height"
android:layout_marginTop="1dp"
android:background="@color/white"
app:tabGravity="fill"
app:tabMode="fixed" />
</android.support.design.widget.AppBarLayout>
check colorPrimary和colorPrimaryDark在您的应用程序主题将出现在style.xml – Reena