main.xml
<?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:paddingTop="5.0dip" > <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="50.0dip" android:background="@drawable/tab_frame_indicator" android:gravity="center" /> <ImageView android:layout_width="fill_parent" android:layout_height="5.0dip" android:background="@drawable/tab_frame_separate" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout> </TabHost>
tab_frame_indicator.xml
<?xml version="1.0" encoding="UTF-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/tab_frame_focus" android:state_pressed="true"/> <item android:drawable="@drawable/tab_frame_focus" android:state_focused="true" android:state_window_focused="true"/> <item android:drawable="@drawable/tab_frame_focus" android:state_selected="true"/> <item android:drawable="@drawable/tab_frame_background" />
</selector>
fl_tabhost_indicator_pitchon.xml
<?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/tab_frame_indicator"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:orientation="horizontal" > <ImageView android:id="@+id/tab_image" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/tab_label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/tab_image" android:textAppearance="?android:textAppearanceSmall" android:textSize="15sp" android:textStyle="bold" android:textColor="@android:color/white" android:visibility="gone" /> </LinearLayout> </RelativeLayout>
效果图:
图片不会上传呀!!!
<!--StartFragment -->