I think the title is pretty explicit about my problem... So here is my layout :
Same question being asked here, with a better explanation of the issue:
https://stackoverflow.com/a/27216368/235910
To quote @CommonsWare:
The problem appears Android 5.0's
elevation
property. Apparently, theRelativeLayout
Z-axis ordering is tied intoelevation
. If both widgets have the sameelevation
, theRelativeLayout
will determine the Z-axis order -- you can see that if you were to switch your layout to be bothButton
widgets, for example. However, if one widget (Button
) has anelevation
, and another widget (ImageView
) does not, theelevation
will take precedence.You can remove the
Button
elevation
viaandroid:stateListAnimator="@null"
or by defining your own custom animator. Or, you can add someelevation
to yourImageView
to get it to be higher on the Z axis than is theButton
.