toolbar homeAsUpIndicator 顏色與點擊 item 效果 === 需要替 `<Toolbar>` 元件套用一個風格的`<style>`屬性檔,如: `android:theme="@style/custom_homeIndicator_color"` * `custom_homeIndicator_color.xml` ```xml= <resources xmlns:tools="http://schemas.android.com/tools"> ... <style name="custom_homeIndicator_color"> <!-- homeIndicator 顏色 --> <item name="colorControlNormal">@color/black</item> <!-- 點擊時的效果背景色 --> <item name="android:colorControlHighlight">@color/lightgray</item> </style> ... </resources> ``` * 我的 `Toolbar` 佈局檔 ```xml= <com.google.android.material.appbar.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/Theme.msiCloud_android.AppBarOverlay"> <androidx.appcompat.widget.Toolbar android:id="@+id/toolbar" app:titleTextColor="@color/black" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/white" android:theme="@style/custom_homeIndicator_color" app:popupTheme="@style/Theme.msiCloud_android.PopupOverlay" /> </com.google.android.material.appbar.AppBarLayout> ``` * 效果(因保護個資碼掉介面部分) ![](https://i.imgur.com/xDmyTzs.jpg) ## Ref. [How to change color of the back arrow in the new material theme?](https://stackoverflow.com/a/31103586) ###### tags: `ActionBar(ToolBar)`