To remove the standard button background image, define your own background image or set the background color to be transparent.
To implement a ImageButton, create three images (for normal, on focus, ad clicked) and place in /drawable folder.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/imgbutton_3" /> <!-- pressed -->
<item android:state_focused="true"
android:drawable="@drawable/imgbutton_2" /> <!-- focused -->
<item android:drawable="@drawable/imgbutton_1" /> <!-- default -->
</selector>
Create a xml in /drawable folder, named imgbutton.xml here.
Add ImageButton in XML, refer to imgbutton.xml as android:background.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<ImageButton
android:layout_width="100dp"
android:layout_height="wrap_content"
/>
<ImageButton
android:id="@+id/myimagebutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/imgbutton"
/>
</LinearLayout>
Dear expert,
ReplyDeletesorry to bother you.
i will study android API, but can't find the API about query andorid platform codec list?
just like https://market.android.com/details?id=com.daberi.example.codeclist&rdid=com.daberi.example.codeclist&rdot=1
,this APP
thnaks
kakabowbow
Hello 九月計劃,
ReplyDeleteI can't run the app, CodecList, in my Nexus One; sorry!
May be this one can help: Android Supported Media Formats.
I'm not expert!