How do i change the color of a Relative Layout i use as a clickable on Click like the normal Button? Like i want a visual feedback the layout was pressed.
I tried it
Try the following steps:
In res --> values folder create color.xml with the content:
#000000
#ffffff
As
tag in selector requires a drawable attribute or child tag defining a drawable, your layout_selector.xml file (which is saved in res --> drawable) should look like this:
Also, as said earlier, the relative layout should be clickable (android:clickable="true"
)
and its background set as android:background="@drawable/layout_selector"
Hope it helps