-1
我使用的是Activity
,它的延伸范围为AppCompatActivity
。我试图从微调器中的颜色列表中选择一种颜色,并将该颜色应用于工具栏。我怎样才能实现这个编程。Android更改工具栏颜色从Google列表中选择颜色颜色 - 附加截图
我的工具栏是:
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:minHeight="?attr/actionBarSize"
android:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
我minSDK是16和CompileSDK为23