Skip to content

Instantly share code, notes, and snippets.

@afreakyelf
Last active March 19, 2019 12:30
Show Gist options
  • Save afreakyelf/010d57e9c6a78a7df67c31e39143b502 to your computer and use it in GitHub Desktop.
Save afreakyelf/010d57e9c6a78a7df67c31e39143b502 to your computer and use it in GitHub Desktop.
Back arrow on toolbar
setSupportActionBar(toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setDisplayShowHomeEnabled(true)
supportActionBar?.setDisplayShowTitleEnabled(false)
//To change the color
<style name="MyToolbarStyle">
<item name="android:minHeight">?actionBarSize</item>
<item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item>
<item name="theme">@style/MyToolbarTheme</item>
</style>
<style name="MyToolbarTheme">
<!-- Used to tint the back arrow, menu and spinner arrow -->
<item name="colorControlNormal">@color/textColorNomal</item>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment