Holo Theme 是Android4.0加入的特性,Holo Theme是Android Design 的一部分。
在4.0手机上,默认的TabHost是Holo风格的,也就是说,其Activty默认的theme是android:theme="@android:style/Theme.Holo"
这种Holo风格的TabHost的indicator,是没有icon图标的,除非你用自定义的indicator view,自定义的indicator view不受theme限制
也就是说,下面这句setIndicator的第二个参数drawable是无效的,显示不出来:
final TabHost tabHost = getTabHost();
tabHost.addTab(tabHost.newTabSpec("tab1")
.setIndicator("tab1", getResources().getDrawable(R.drawable.star_big_on))
你可以在manifest文件里面显示声明使用老版本的theme,你确定要倒退到遥远的过去吗?
<activity android:name=".view.Tabs4" android:label="Views/Tabs/4. Non Holo theme"
android:theme="@android:style/Theme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.SAMPLE_CODE"/>
</intent-filter>
</activity>