Tabs with ActionBarSherlock and Fragments with Top Nav bar

妖精的绣舞 提交于 2019-12-14 03:03:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!