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?
In Android applications, ActionBar is the element present at the top of the activity screen. It is a salient feature of a mobile application that has a consistent presence over all its activities. It provides a visual structure to the app and contains some of the frequently used elements for the users.
If you want to hide Action Bar from the entire application (from all Activities and fragments), then you can use this method. Just go to res -> values -> styles. xml and change the base application to “Theme. AppCompat.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With