How can I specify a border color for an ImageView when it has focus

by Roy » Tue, 04 Aug 2009 23:15:00 GMT

Sponsored Links
 You can create a xml file under res/drawable. For example: res/

Here is the content:
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="" ;>
        <item android:state_pressed="true" android:drawable="@drawable/
shape_2" />
        <item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/shape_5" />

Here is shape_2.xml
<shape xmlns:android="" ;>
    <solid android:color="#FF0000FF"/>
    <stroke android:width="4dp" android:color="#FFFFFFFF"
            android:dashWidth="1dp" android:dashGap="2dp" />
    <padding android:left="7dp" android:top="7dp"
            android:right="7dp" android:bottom="7dp" />
    <corners android:radius="4dp" />


Other Threads

1. Tidak Bisa Download di Market

Dear All,

Kok saya tidak download Aplikasi di Market ya?

Mohon pencerahan nya..




2. Mana ponsel androidnya ?

itu yg samsung bukannya samsung galaxy s om?

- -


3. Location & Market Rating System

4. mohon info batere - Galaxy 5

5. Intent filter targeting specific SDK version

6. Attach debugger to app that is already running

7. How to detect FPS (frame per second) in video ?