try using this
tabHost = (TabHost)findViewById(android.R.id.tabhost);
Intent intent1 = new Intent(this, javaclass.class);
TabSpec tab1 = tabHost.newTabSpec("tid1");
ImageView img1 = new ImageView(this);
img1.setLayoutParams(new LayoutParams(tabWidth, tabHeight));
img1.setBackgroundColor(Color.TRANSPARENT);
tab1.setIndicator(img1).setContent(intent1);
如下文所示为Xml Layout的背景
<RelativeLayout
android:id="@+id/layTab"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:background="@drawable/image"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
/>
</RelativeLayout>