Dim card As B4XView = xui.CreatePanel("card")
card.SetLayoutAnimated(0,0,0,100dip,100dip)
Dim Offset As Float = 5
card.As(JavaObject).RunMethod("setElevation", Array(Offset))
card.As(JavaObject).RunMethod("setOutlineAmbientShadowColor",Array(xui.Color_Red))
But its not working:
java.lang.RuntimeException: Method: setOutlineAmbientShadowColor not found in: anywheresoftware.b4a.BALayout
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
Dim card As B4XView = xui.CreatePanel("card")
Root.AddView(card,0,0,100dip,100dip)
card.Color = xui.Color_Blue
Dim Offset As Float = 30dip
card.As(JavaObject).RunMethod("setElevation", Array(Offset))
card.As(JavaObject).RunMethod("setOutlineAmbientShadowColor",Array(xui.Color_Red))
End Sub
Though I don't see any change in the shadow color.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
Dim card As B4XView = xui.CreatePanel("card")
Root.AddView(card,0,0,100dip,100dip)
card.Color = xui.Color_Blue
Dim Offset As Float = 30dip
card.As(JavaObject).RunMethod("setElevation", Array(Offset))
card.As(JavaObject).RunMethod("setOutlineAmbientShadowColor",Array(xui.Color_Red))
End Sub
Though I don't see any change in the shadow color.
Seems like its depending on the emulator i used.
It works on a real device.
We also need to use setOutlineSpotShadowColor in order to show the color
B4X:
Dim card As B4XView = xui.CreatePanel("card")
Root.AddView(card,100dip,100dip,100dip,100dip)
card.Color = xui.Color_Blue
Dim Offset As Float = 30dip
card.As(JavaObject).RunMethod("setElevation", Array(Offset))
card.As(JavaObject).RunMethod("setOutlineAmbientShadowColor",Array(xui.Color_Red))
card.As(JavaObject).RunMethod("setOutlineSpotShadowColor",Array(xui.Color_Red))
Maybe this function can be added to the B4XView class
like