I created an xml-file
(drawable) for my TableRow layout, which looks like this:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://ift.tt/nIICcg">
<item android:state_pressed="true" >
<shape>
<solid
android:color="#03114e" />
<stroke
android:width="1dp"
android:color="#2f6699" />
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item>
<shape>
<solid
android:color="#829fbc" />
<stroke
android:width="1dp"
android:color="#17456b" />
<corners
android:radius="3dp" />
<padding
android:left="6dp"
android:top="6dp"
android:right="6dp"
android:bottom="6dp" />
</shape>
</item>
</selector>
It's actually supposed to change the background of the TableRow when the user touches it. Unfortunately, nothing happens.
The default background (defined between the second item
-tag) works perfectly well. However, the state_pressed
argument has no use.
I even tried state_focused
, but still without use.
Ideas?
No comments:
Post a Comment