Button always displays on top in FrameLayout

后端 未结 7 711
醉梦人生
醉梦人生 2020-12-03 00:34

I have FrameLayout like this:



        
7条回答
  •  难免孤独
    2020-12-03 01:29

    This answer

    Buttons in Lollipop and higher have a default elevation to them which causes them to always draw on top. You can change this by overriding the default StateListAnimator.

    Try putting this into your button XML:

    android:stateListAnimator="@null"

    The FrameLayout should now cover the button.

提交回复
热议问题