Actionbar is displaying below tabs when I call setDisplayShowHomeEnabled(false);

1,075 views
Skip to first unread message

ToddManUtah

unread,
Mar 8, 2012, 12:46:10 AM3/8/12
to actionba...@googlegroups.com
I have a strange thing happening.  I have an actionbar with a refresh button added by associated fragments.  I want the actionbar to have the title but not the home icon.

The following code shows the title bar below the tabs.  If I remove the line "bar.setDisplayShowHomeEnabled(false);", the title bar appears on top of the tabs as expected (and wanted).  Any ideas?

        @Override  protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);


        // Set up the view pager

        setContentView(R.layout.fragment_tabs_pager);

        mViewPager = (ViewPager)findViewById(R.id.pager);

        

        // Set up action bar

        final ActionBar bar = getSupportActionBar();

        bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

        bar.setDisplayShowTitleEnabled(true);

        bar.setDisplayShowHomeEnabled(false);

Jake Wharton

unread,
Mar 8, 2012, 12:47:43 AM3/8/12
to actionba...@googlegroups.com
This is the behavior of the native action bar on ICS. I have no idea why it does it. If you think it's an incorrect behavior feel free to file a bug on http://b.android.com and follow-up with a link to the bug. For now we're just stuck imitating what ICS does.

---
Jake Wharton
http://about.me/jakewharton

ToddManUtah

unread,
Mar 8, 2012, 9:35:20 AM3/8/12
to actionba...@googlegroups.com
Strange.  I see the behavior on all versions, not just ICS.  We'll, I guess I'm stuck with the icon.  Thanks for your help.


On Wednesday, March 7, 2012 10:47:43 PM UTC-7, Jake Wharton wrote:
This is the behavior of the native action bar on ICS. I have no idea why it does it. If you think it's an incorrect behavior feel free to file a bug on http://b.android.com and follow-up with a link to the bug. For now we're just stuck imitating what ICS does.

---
Jake Wharton
http://about.me/jakewharton


Jake Wharton

unread,
Mar 8, 2012, 12:06:39 PM3/8/12
to actionba...@googlegroups.com
I meant the fact that it occurs on ICS is important because that is the native action bar. The fact that it occurs on all versions of Android is our desired behavior since it means the library's compatibility action bar is acting the same way as native.

Todd Lawson

unread,
Mar 8, 2012, 12:08:14 PM3/8/12
to actionba...@googlegroups.com
Got it.  Thanks again for the help.

Lalit Patil

unread,
Aug 17, 2015, 2:32:58 AM8/17/15
to ActionBarSherlock
hey ToddManUtah
did you solve your problem?
if yes please, let me know how do you solve this problem?
because i have same issue generated...
please help me

Todd Lawson

unread,
Aug 17, 2015, 9:05:15 AM8/17/15
to actionba...@googlegroups.com
I couldn't get it to work right and went in another direction.  Sorry.

Todd Lawson, President & Founder
Mobility Initiative


--
You received this message because you are subscribed to a topic in the Google Groups "ActionBarSherlock" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/actionbarsherlock/L5LcS0o7O0w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to actionbarsherl...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages