Skip to content

Instantly share code, notes, and snippets.

@martyglaubitz
Last active August 29, 2015 14:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martyglaubitz/c2636ca6689b992ae058 to your computer and use it in GitHub Desktop.
Save martyglaubitz/c2636ca6689b992ae058 to your computer and use it in GitHub Desktop.
Fix: Android Actionbar Tabs appear over ActionBar
final View homeIcon = findViewById(android.R.id.home);
((View) homeIcon.getParent()).setVisibility(View.GONE);
<style name="AppTheme.ActionBar" parent="@style/Widget.AppCompat.ActionBar">
<!-- visually "hide" the icon itself-->
<item name="android:icon">@android:color/transparent</item>
<item name="icon">@android:color/transparent</item>
<!-- these are required to prevent the tabs getting over the actionbar when adding a customview to it -->
<item name="android:displayOptions">showCustom|showHome</item>
<item name="displayOptions">showCustom|showHome</item>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment