How to remove border/shadow from lollipop buttons

前端 未结 11 1528
借酒劲吻你
借酒劲吻你 2020-12-12 19:21

The buttons looks fine for api < 21. However, the +21 versions creates this border or shadow that is shown on the image below. How do I get rid of it without changeing th

11条回答
  •  遥遥无期
    2020-12-12 20:00

    "shadow" effect is added on Lollipop Appcompat theme

    add the following line in res/values-v21/styles.xml to remove default shadow

    Theme level:

    @style/Widget.AppCompat.Button.Borderless
    

    xml layout:

    android:stateListAnimator="@null"
    

    Java:

    setStateListAnimator(null);
    

    Kotlin:

    stateListAnimator = null
    

提交回复
热议问题