- <LinearLayout android:id="@+id/status_toolbar"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:orientation="horizontal"
- android:background="@drawable/status_toolbar_bg"
- android:gravity="center_vertical|center_horizontal"
- >
- <RadioButton
- android:background="@android:color/transparent"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:button="@null"
- android:drawableTop="@drawable/status_refresh_selector"
- android:gravity="center"
- android:text="刷新"
- android:layout_weight="1"
- android:textColor="@color/white" />
- <RadioButton android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:button="@null"
- android:text="评论"
- android:gravity="center"
- android:layout_weight="1"
- android:background="@android:color/transparent"
- android:textColor="@color/white"
- android:drawableTop="@drawable/status_comment_selector"></RadioButton>
- <RadioButton android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:button="@null"
- android:text="转发"
- android:gravity="center"
- android:layout_weight="1"
- android:background="@android:color/transparent"
- android:textColor="@color/white"
- android:drawableTop="@drawable/status_forward_selector"></RadioButton>
- <RadioButton android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:button="@null"
- android:text="收藏"
- android:gravity="center"
- android:layout_weight="1"
- android:background="@android:color/transparent"
- android:textColor="@color/white"
- android:drawableTop="@drawable/status_fav_selector"></RadioButton>
- <RadioButton android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:button="@null"
- android:text="更多"
- android:gravity="center"
- android:layout_weight="1"
- android:background="@android:color/transparent"
- android:textColor="@color/white"
- android:drawableTop="@drawable/status_more_selector"></RadioButton>
- </LinearLayout>
关键语句功能:
android:button="@null" 删除原本系统默认在左的选择框
android:background="@android:color/transparent" 去除左边选择框被删除后的空白
android:drawableTop="@drawable/status_more_selector" 选择图片在文字上面
android:gravity="center" 保证文字与图片在平行
android:layout_weight="1" 使每一个RadioButton占的空间一样大