android - how to make a difference on Imagebutton click -
i design button in round shape using below code , want show text on button used frame layout , put text on button. challange button still.it doesnot show effect on click drawable , src both used 1 roundshape button , other image on button (respectivitly).
now button doesnot make effect on design on click how make effect.
<framelayout> <imagebutton android:id="@+id/btn_profile_view" android:layout_width="70dp" android:layout_height="67dp" android:layout_marginleft="20dp" android:layout_marginright="20dp" android:layout_margintop="20dp" android:layout_weight="1" android:onclick="comparebuttonclick" android:background="@drawable/roundedbutton" android:src="@drawable/ic_action_person" /> <textview android:layout_width="45dp" android:layout_height="20dp" android:layout_gravity="bottom" android:layout_marginleft="38dp" android:clickable="false" android:text="@string/profile" android:textcolor="@color/btn_txt" > </textview> </framelayout> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#d3d3d3" /> <corners android:bottomleftradius="8dip" android:bottomrightradius="8dip" android:topleftradius="8dip" android:toprightradius="8dip" />
here click call back, dont need set click listener anywhere
public void comparebuttonclick(view v){ toast.maketext(this, "image button click", toast.length_short).show(); }