0

In order to describe exactly what a button is meant for, I was trying to place a descriptive image over the button which is big enough to accommodate the image. I wanted the app to work for devices using api 20 and below. I went through the answers given at these two places

elevation not working .
placing imageview over button

The answer given at the second link does work for API levels 21 and above but not for those below because item name="android:stateListAnimator" does not seem to be directly accessible in them. What should I do?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Anubhav Pandey
  • 1,285
  • 1
  • 14
  • 18
  • Please provide your current impl in the form of layout and anything associated. – ror Dec 15 '19 at 15:03

1 Answers1

0

What you want to use is FrameLayout. FrameLayout children order is a Z order so You do something like:

 <FrameLayout>
    <Button>
    <ImageView>
 </FrameLayout>

Another way is to set the button background as the image of the image view.

Uriel Frankel
  • 14,304
  • 8
  • 47
  • 69