Android Question Remove button shadow

Buttons are elevated by default in the material theme. If you set their background to a non-default background then the elevation will be removed.
I set background for it with Statelistdrawable
But some button didn't removed shadow
 
Upvote 0
I have the same problem and I have already changed the background but in the certain displays show this:

The second image show in the s6 edge display and others phones and tablets ba4calendar.png Screenshot_20170810-131041.png
 
Upvote 0
No, I did not fix it.
The problem is that the version of android lollipop has introduced this thing, and to remove it we need to call button.setStateListAnimator (null) but this is not possible in B4a.

Is there a trick to do that?
 
Upvote 0
No, I did not fix it.
The problem is that the version of android lollipop has introduced this thing, and to remove it we need to call button.setStateListAnimator (null) but this is not possible in B4a.

Is there a trick to do that?
I use below sub
Code: Copy
Sub RemoveShadow(Button1 As Button)
    Dim sdk As Phone
    If sdk.SdkVersion < 21 Then Return
    Dim jo As JavaObject
    jo = Button1
    jo.RunMethod("setStateListAnimator", Array(Null))
End Sub
 
Upvote 0
Back
Top