I am developing an application which consists of button. Here Is My problem,how to set the selected state and unselected state.
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/ox_mnu_dashboard_over" android:state_selected="true"/> <item android:drawable="@drawable/ox_mnu_dashboard_normal"/> </selector> I am using this code but not working for me. Here is the xml file:
<FrameLayout android:id="@+id/tabDashboard" android:layout_width="60dip" android:layout_height="wrap_content" android:layout_marginLeft="2dip" android:layout_weight="1" android:clickable="true" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|center_horizontal" android:focusableInTouchMode="true" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:singleLine="true" android:text="@string/dashboard" android:textColor="@color/white" android:textSize="12sp" /> <ImageButton android:id="@+id/btnDashboard" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/tab_dashboard" android:clickable="true" /> </FrameLayout>