Emme Developer Well-Known Member Licensed User Longtime User Jan 24, 2018 #1 Hi to all! I've a button created programmatically. How can i set elevation to 0, and disable the shadow when i click on it? I tried this code, but on some devices happens what explained in this topic: https://www.b4x.com/android/forum/threads/app-crash-without-filter-logs.88681/ Code: Sub setElevation (b As View ,f As Float) Dim sdk As Phone Dim jo As JavaObject = b If sdk.SdkVersion > 20 Then jo.RunMethod("setElevation",Array As Object(f)) jo.RunMethod("setStateListAnimator", Array(Null)) End If End Sub
Hi to all! I've a button created programmatically. How can i set elevation to 0, and disable the shadow when i click on it? I tried this code, but on some devices happens what explained in this topic: https://www.b4x.com/android/forum/threads/app-crash-without-filter-logs.88681/ Code: Sub setElevation (b As View ,f As Float) Dim sdk As Phone Dim jo As JavaObject = b If sdk.SdkVersion > 20 Then jo.RunMethod("setElevation",Array As Object(f)) jo.RunMethod("setStateListAnimator", Array(Null)) End If End Sub
D Deleted member 103 Guest Jan 24, 2018 #2 Emme Developer said: Hi to all! I've a button created programmatically. How can i set elevation to 0, and disable the shadow when i click on it? I tried this code, but on some devices happens what explained in this topic: https://www.b4x.com/android/forum/threads/app-crash-without-filter-logs.88681/ Code: Sub setElevation (b As View ,f As Float) Dim sdk As Phone Dim jo As JavaObject = b If sdk.SdkVersion > 20 Then jo.RunMethod("setElevation",Array As Object(f)) jo.RunMethod("setStateListAnimator", Array(Null)) End If End Sub Click to expand... why do not you use a label or panel instead of a button? Upvote 0
Emme Developer said: Hi to all! I've a button created programmatically. How can i set elevation to 0, and disable the shadow when i click on it? I tried this code, but on some devices happens what explained in this topic: https://www.b4x.com/android/forum/threads/app-crash-without-filter-logs.88681/ Code: Sub setElevation (b As View ,f As Float) Dim sdk As Phone Dim jo As JavaObject = b If sdk.SdkVersion > 20 Then jo.RunMethod("setElevation",Array As Object(f)) jo.RunMethod("setStateListAnimator", Array(Null)) End If End Sub Click to expand... why do not you use a label or panel instead of a button?
Emme Developer Well-Known Member Licensed User Longtime User Jan 24, 2018 #3 Filippo said: why do not you use a label or panel instead of a button? Click to expand... Maybe because i should to rewrite 20 pages of code By the way, also because in some cases i need to see the animation of the button when someone clicks on it Upvote 0
Filippo said: why do not you use a label or panel instead of a button? Click to expand... Maybe because i should to rewrite 20 pages of code By the way, also because in some cases i need to see the animation of the button when someone clicks on it
Erel B4X founder Staff member Licensed User Longtime User Jan 24, 2018 #4 Why do you want to remove this nice animation? Upvote 0
Emme Developer Well-Known Member Licensed User Longtime User Jan 24, 2018 #5 Erel said: Why do you want to remove this nice animation? Click to expand... I would like to know it too ... directives from designers Upvote 0
Erel said: Why do you want to remove this nice animation? Click to expand... I would like to know it too ... directives from designers
Erel B4X founder Staff member Licensed User Longtime User Jan 24, 2018 #6 Are you getting these crashes on Android 5 devices? Maybe you should apply your code on Android 6+. Upvote 0
Emme Developer Well-Known Member Licensed User Longtime User Jan 24, 2018 #7 Erel said: Are you getting these crashes on Android 5 devices? Maybe you should apply your code on Android 6+. Click to expand... Yes this can be a solution. But as i see, it's no possible to remove it on Android 5 or less Upvote 0
Erel said: Are you getting these crashes on Android 5 devices? Maybe you should apply your code on Android 6+. Click to expand... Yes this can be a solution. But as i see, it's no possible to remove it on Android 5 or less
Erel B4X founder Staff member Licensed User Longtime User Jan 24, 2018 #8 As @Filippo wrote you can use a label instead of a button. Upvote 0