原来做项目的时候,实现选中效果,都是用selector来实现,虽然可以实现变化效果,但是比较死板。
1。先贴上布局文件
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="46.0dip"
android:background="@drawable/bottom_bg" >
<TextView
android:id="@id/bottom_select"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/main_menu_press" />
<RadioGroup
android:id="@id/bottom_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<RadioButton
android:id="@id/bottom_homepage"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_weight="1.0"
android:background="@drawable/transparent"
android:button="@null"
android:checked="false"
andro