我遇到了类似的问题。至少部分解决方案是将 tabLayout 属性添加到 res/values/attrs.xml。下面是从 android-16 平台复制的 TabWidget 样式的定义(注意末尾的 tabLayout 属性):
<declare-styleable name="TabWidget">
<!-- Drawable used to draw the divider between tabs. -->
<attr name="divider" />
<!-- Determines whether the strip under the tab indicators is drawn or not. -->
<attr name="tabStripEnabled" format="boolean" />
<!-- Drawable used to draw the left part of the strip underneath the tabs. -->
<attr name="tabStripLeft" format="reference" />
<!-- Drawable used to draw the right part of the strip underneath the tabs. -->
<attr name="tabStripRight" format="reference" />
<!-- Layout used to organize each tab's content. -->
<attr name="tabLayout" format="reference" />
</declare-styleable>
由于您是压倒一切的,因此您还需要更改:
<item name="android:tabLayout">...
至:
<item name="tabLayout">...