6

I'm using the ActionBarSherlock for my application and this is the code I use to hide the Title of ActionBar :

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayUseLogoEnabled(true);
    setContentView(R.layout.main_fragment);
}

The problem with this is that when the application starts there is a short amount of time when the Logo and Title are shown simultaneously. This looks really ugly, How can I get rid of that?

Binoy Babu
  • 16,699
  • 17
  • 91
  • 134

1 Answers1

17

This is my solution, we need to define a new style and declare it in the Manifest

<style name="VibhinnaTheme" parent="Theme.Sherlock.Light.ForceOverflow">
    <item name="android:actionBarStyle">@style/VibhinnaTheme.ActionBar</item>
    <item name="actionBarStyle">@style/VibhinnaTheme.ActionBar</item>
</style>

<style name="VibhinnaTheme.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid">
    <item name="android:displayOptions">showHome|useLogo</item>
    <item name="displayOptions">showHome|useLogo</item>
</style>

This link was helpful : LINK

Binoy Babu
  • 16,699
  • 17
  • 91
  • 134