PowenKo, Android Tutorial 043, image process, custom button.

September 1, 2011   ·   0 Comments

res\drawable\btn_default_small_selected.png

res\drawable\@drawable/btn_default_small_pressed.png

res\drawable\cumtom_btm1.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_window_focused="false" android:state_enabled="true"
        android:drawable="@drawable/btn_default_small_selected" />
    <item android:state_window_focused="false" android:state_enabled="false"
        android:drawable="@drawable/btn_default_small_selected" />
    <item android:state_pressed="true"
        android:drawable="@drawable/btn_default_small_pressed" />
    <item android:state_focused="true" android:state_enabled="true"
        android:drawable="@drawable/btn_default_small_selected" />
    <item android:state_enabled="true"
        android:drawable="@drawable/btn_default_small_selected" />
    <item android:state_focused="true"
        android:drawable="@drawable/btn_default_small_selected" />
    <item
         android:drawable="@drawable/btn_default_small_selected" />
</selector>

 

<?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"
    android:weightSum="1">
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="PowenKo.com"
    />
<ImageButton android:background="@drawable/cumtom_btm1" android:layout_height="wrap_content" android:id="@+id/imageButton1" android:layout_width="103dp" android:layout_weight="0.07"></ImageButton>
</LinearLayout>

sample code:
Tutorial_UI_Cumtom_Button

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Android7

Amazon

adsbygoogle

Recent Posts

Categories

Amazon