有没有什么办法让来自其他多个样式风格继承,而不是仅仅局限于:
<样式名称=WidgetTextBase>
<项目名称=机器人:字体>衬线< /项目>
<项目名称=机器人:TEXTSIZE> 12dip< /项目>
<项目名称=安卓重力>中心< /项目>
< /风格>
<样式名称=BOSText父=WidgetTextBase>
<项目名称=机器人:文字颜色>#051C43< /项目>
< /风格>
我想BOSText也从继承:
<样式名称=WidgetTextHeader>
<项目名称=机器人:TEXTSTYLE>大胆< /项目>
<风格>
解决方案
没有,样式不支持多重继承(至少不会成为Android 3.2的)。
Is there any way to make a style inherit from multiple other styles, instead of just being limited to:
<style name="WidgetTextBase">
<item name="android:typeface">serif</item>
<item name="android:textSize">12dip</item>
<item name="android:gravity">center</item>
</style>
<style name="BOSText" parent="WidgetTextBase">
<item name="android:textColor">#051C43</item>
</style>
I would like BOSText to also inherit from:
<style name="WidgetTextHeader">
<item name="android:textStyle">bold</item>
<style>
解决方案
No, styles do not support multiple inheritance (at least not as of Android 3.2).