带下拉导航的ActionBarSherlock不显示具有自定义视图的选项卡

时间:2013-04-17 20:41:10

标签: android tabs actionbarsherlock

我正在使用操作栏导航,用户可以动态添加标签。导航模式设置为:

  setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); 

我使用android 4.0.3在7'tablet上运行app所以在横向和纵向模式下我都嵌入了标签,直到Action Bar用完空间并切换到下拉导航。

在单击视图之前是微调器的标准,在层次结构查看器中它包含微调器 - > spinnerTabContainerView $ TabView-> FrameLayout->的TextView。这是图片:

before click

当我点击它而不是向我显示标签列表时,它会显示如下:

post click

基本上它会显示所有选项卡,但不会显示在下拉列表中,也不显示我的自定义视图。在层次结构查看器中,它显示为scrollingTabContainerView-> LinearLayout->和许多ScrollingTabContainerView $ TabView

我几乎尝试了一切,我不知道下一步该做什么。

以下是一些消息来源:

-SherlockActionBar Theming

<resources>
<style name="MyTheme" parent="Theme.Sherlock.Light">
    <item name="android:actionBarStyle">@style/MyActionBarStyle</item>
    <item name="actionBarStyle">@style/MyActionBarStyle</item>

    <item name="actionBarSize">56dip</item>
    <item name="android:actionBarSize">56dip</item>
</style>

<style name="MyActionBarTabStyle" parent="Widget.Sherlock.Light.ActionBar.TabView">
    <item name="android:padding">0dp</item>
</style>

<style name="MyActionBarStyle" parent="Widget.Sherlock.Light.ActionBar">
    <item name="android:background">#DABA79</item>
</style>

- 我的自定义标签视图

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/action_custom_tab"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@android:style/TextAppearance.Large"

/>

</FrameLayout>

0 个答案:

没有答案
相关问题