private void initGui() {
tabHost = (TabHost)findViewById(android.R.id.tabhost);
tabHost.setup();//?????????
tabHost.setPadding(tabHost.getPaddingLeft()??
tabHost.getPaddingTop()?? tabHost.getPaddingRight()??
tabHost.getPaddingBottom() - 3);
TabWidget tabWidget = tabHost.getTabWidget();
// ???????Table???
addDynamicTab(tabHost?? tabWidget);
addFindTab(tabHost?? tabWidget);
addShareTab(tabHost?? tabWidget);
addSnsTab(tabHost?? tabWidget);
addMoreTab(tabHost?? tabWidget);
tabHost.setCurrentTab(0);
}

????????????????Tab??????????????????????????????????????????д????????????????????

 

privatevoidaddDynamicTab(TabHosthost??TabWidgettw){
RelativeLayoutindicator=(RelativeLayout)LayoutInflater.from(this).inflate(R.layout.tab_bottom_indicator??tw??false);
ImageViewimg=(ImageView)indicator.getChildAt(0);
img.setBackgroundResource(R.drawable.main_bottom_tab1);
TextViewtabText=(TextView)indicator.getChildAt(1);
tabText.setText(getResources().getString(R.string.j_main_tab_dynamic));
tabText.setTextColor(getResources().getColor(R.color.white));
TabSpectabSpec=host.newTabSpec(MAIN_TAB_DYNAMIC);
tabSpec.setIndicator(indicator);
tabSpec.setContent(R.id.j_dynamicFragment);
host.addTab(tabSpec);
}

?????????????????Tab??????????????????????????????
???????????Tab???????壬????????????????漲??

 

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="vertical"
android:background="@drawable/tab_bottom_selector"
android:paddingTop="6dip"
android:paddingBottom="4dip"
android:gravity="center_horizontal">
<ImageView android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
/>
<TextView android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:textSize="14sp"
android:textColor="@color/black" />
</RelativeLayout>

??????????????????????????????????