res/drawable/tab_indicator.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/tab_focus" /> <item android:state_pressed="true" android:drawable="@drawable/buttonbar_pressed" /> <item android:state_focused="true" android:drawable="@drawable/buttonbar_focused" /> <item android:drawable="@drawable/buttonbar_normal" /> </selector>
res/color/tab_indicator_text.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_selected="true" android:color="#FF102542" /> <item android:state_focused="true" android:color="#FF102542" /> <item android:state_pressed="true" android:color="#FF102542" /> <item android:color="#FFC2C2C2" /> </selector>
res/layout/tab_indicator.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="0dip" android:layout_height="70dip" android:layout_weight="1" android:layout_marginLeft="-3dip" android:layout_marginRight="-3dip" android:orientation="vertical" android:background="@android:drawable/tab_indicator"> <ImageView android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" /> <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:textSize="14px" style="?android:attr/tabWidgetStyle" /> </RelativeLayout>
时间: 2024-09-24 03:51:00