9
我的代碼是:更改工具欄主題編程
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="@style/Toolbar_Theme"/>
我想改變應用程序:主題java代碼。 我可以找到任何方法作爲toolbar.setTheme
用於改變工具欄的風格?
你只能改變背景顏色和標題使用顏色代碼: toolbar.setBackgroundColor(newColor); toolbar.setTitleTextColor(titleColor); – Lazai
@Lazai謝謝 –
試試這個:https://stackoverflow.com/questions/31225189/how-to-change-appcompat-v21-toolbar-theme-programmatically –