与ActionBarSherlock标签和片段与顶部导航栏 [英] Tabs with ActionBarSherlock and Fragments with Top Nav bar
问题描述
我采取相同的设计:的Android ActionBarSherlock顶酒吧并使用接受答案code。虽然这是推动我下面的标签我的导航栏:
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:
。
.
任何想法,为什么?
推荐答案
它是一种与ActionBarSherlock(从错误的 https://github.com/JakeWharton/ActionBarSherlock/issues/327 )。
Its a bug with ActionBarSherlock (from https://github.com/JakeWharton/ActionBarSherlock/issues/327 ).
原因:
当你调用setDisplayShowHomeEnabled(假)中的onCreate(),并
使用标签导航模式时,标签将显示在操作栏上方
相对于在其下方。
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.
解决方法:结果
取出setDisplayShowHomeEnabled电话,并添加此相反:
Workaround:
Remove the setDisplayShowHomeEnabled call, and add this instead:
View homeIcon = findViewById(android.R.id.home);
((View) homeIcon.getParent()).setVisibility(View.GONE);
这篇关于与ActionBarSherlock标签和片段与顶部导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!