xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="right" android:orientation="horizontal" android:focusable="true" android:focusableInTouchMode="true" android:paddingRight="20dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5dp" android:background="@drawable/huizong_selector" android:clickable="true" android:focusable="true" android:focusableInTouchMode="true" android:padding="5dp" android:text="维护日报" android:textSize="20sp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5dp" android:background="@drawable/huizong_selector" android:clickable="true" android:focusable="true" android:focusableInTouchMode="true" android:padding="5dp" android:text="维护周报" android:textSize="20sp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5dp" android:background="@drawable/huizong_selector" android:clickable="true" android:padding="5dp" android:focusable="true" android:focusableInTouchMode="true" android:text="维护月报" android:textSize="20sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/hui"></LinearLayout> </LinearLayout>
selector
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="false" > <shape> <corners android:radius="5dp"/> <solid android:color="@color/colorLightGray"></solid> </shape> </item> <item android:state_focused="true" > <shape> <corners android:radius="5dp"/> <solid android:color="@color/colorDeepBlue"></solid> </shape> </item> </selector>