【发布时间】:2013-02-11 20:46:19
【问题描述】:
我的标签栏图标不会显示
TabHost tabHost = getTabHost();
TabSpec barcodeInsertSpec = tabHost.newTabSpec("Barcode Insert");
barcodeInsertSpec.setIndicator("Barcode Insert", getResources().getDrawable(R.drawable.home2));
barcodeInsertSpec.setContent(new Intent(getBaseContext(), BarcodeInsertActivity.class));
tabHost.addTab(barcodeInsertSpec);
drawable/home2.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- When not selected, use that-->
<item android:drawable="@drawable/home22" />
</selector>
并将图片放在三个不同尺寸(48x48、32x32、24x24)的文件夹中drawable-hdpi , drawable-ldpi, ... as .png
喜欢drawable-hdpi/home22.png
【问题讨论】:
标签: android xml icons android-tabhost tabbar