how to set a bitmap in a shape in xml



I 'm using this for a LinearLayout's selector


normal.xml:



<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://ift.tt/nIICcg">
<solid android:color="#FFFFFF"/>
</shape>


pressed.xml



<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://ift.tt/nIICcg">
<solid android:color="#F89E1C"/>
</shape>


selector



<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://ift.tt/nIICcg">
<item android:state_pressed="true" android:drawable="@drawable/pressed" />
<item android:state_focused="false" android:drawable="@drawable/normal" />
</selector>


how can I set a bitmap in the pressed.xml instead of a color?


Tiada ulasan:

Catat Ulasan