问题
I am implementing the same design as described here: Android ActionBarSherlock Top Bar and using the accepted answers code. Although it is pushing my nav bar below my tabs:
Valid XHTML http://img255.imageshack.us/img255/8908/tabsa.png.
Any idea why?
回答1:
Its a bug with ActionBarSherlock (from https://github.com/JakeWharton/ActionBarSherlock/issues/327 ).
Cause:
When you call setDisplayShowHomeEnabled(false) in onCreate() and are using a tab navigation mode, the tabs will appear above the action bar as opposed to below it.
Workaround:
Remove the setDisplayShowHomeEnabled call, and add this instead:
View homeIcon = findViewById(android.R.id.home);
((View) homeIcon.getParent()).setVisibility(View.GONE);
来源:https://stackoverflow.com/questions/12356422/tabs-with-actionbarsherlock-and-fragments-with-top-nav-bar