0

I want to remove the icon on action bar and i want to display only title. I did it by using

ActionBar.setDisplayUseLogoEnabled(false);

and

ActionBar.setDisplayShowHomeEnabled(false);

But the action bar is showing below the tab.so please help me how to solve the issue. thanks in advance.`

mmBs
  • 8,421
  • 6
  • 38
  • 46
Shruthi
  • 29
  • 1
  • 11
  • possible duplicate of [Remove icon/logo from action bar on android](http://stackoverflow.com/questions/14606294/remove-icon-logo-from-action-bar-on-android) – Paul Lammertsma Oct 19 '13 at 19:12

2 Answers2

2

I haven't actually tried, but I believe you can specifying the display options in such a way as to only display the title:

actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE);

If you'd like to do it purely through XML, this answer recommends:

<item name="android:displayOptions">showHome|homeAsUp|showTitle</item>
<item name="displayOptions">showHome|homeAsUp|showTitle</item>
<item name="android:icon">@android:color/transparent</item>
Community
  • 1
  • 1
Paul Lammertsma
  • 37,593
  • 16
  • 136
  • 187
0

Try this:

<style name="YourTheme" parent="@style/Theme.Sherlock.Light">
    <item name="android:actionBarStyle">@style/YourActionBar</item>
    <item name="actionBarStyle">@style/YourActionBar</item>
</style>

<style name="YourActionBar" parent="@style/Widget.Sherlock.Light.ActionBar">
    <item name="android:displayOptions">showTitle</item>
    <item name="displayOptions">showTitle</item>
</style>

And in your Activity:

ActionBar.setDisplayShowTitleEnabled(true);

It worked for me! Hope this help.

Blo
  • 11,903
  • 5
  • 45
  • 99