D Deleted member 103 Guest Mar 7, 2017 #1 Hi, I do not know if there is an error, fact is the function Panel.Elevation does not always work. Works with GradientDrawable, but not with ColorDrawable. Here is my code, once with GradientDrawable and once with ColorDrawable. Code: Copy Dim dr As ColorDrawable dr.Initialize(Colors.Red, pnlMicrophon.Width / 2) pnlMicrophon.Background = dr pnlMicrophon.Elevation = 5dip '.SetElevationAnimated(1, 5dip) Code: Copy Dim dr As GradientDrawable dr.Initialize("TR_BL", Array As Int(Colors.Red, Colors.Red)) dr.CornerRadius = pnlMicrophon.Width / 2 pnlMicrophon.Background = dr pnlMicrophon.Elevation = 5dip
Hi, I do not know if there is an error, fact is the function Panel.Elevation does not always work. Works with GradientDrawable, but not with ColorDrawable. Here is my code, once with GradientDrawable and once with ColorDrawable. Code: Copy Dim dr As ColorDrawable dr.Initialize(Colors.Red, pnlMicrophon.Width / 2) pnlMicrophon.Background = dr pnlMicrophon.Elevation = 5dip '.SetElevationAnimated(1, 5dip) Code: Copy Dim dr As GradientDrawable dr.Initialize("TR_BL", Array As Int(Colors.Red, Colors.Red)) dr.CornerRadius = pnlMicrophon.Width / 2 pnlMicrophon.Background = dr pnlMicrophon.Elevation = 5dip
Erel B4X founder Staff member Licensed User Longtime User Mar 7, 2017 #2 Seems to work fine here. Check the attached project (click on the activity to see the difference). Attachments 1.zip 1.zip 7.7 KB · Views: 680 Upvote 0
D Deleted member 103 Guest Mar 7, 2017 #3 Unfortunately your example does not work. Try with Samsung-S4(5.01) and HTC-One-A9(6.01). It only works when I use this code. Code: Copy Dim dr As GradientDrawable dr.Initialize("TR_BL", Array As Int(Colors.Red, Colors.Red)) dr.CornerRadius = Panel1.Width / 2 Panel1.Background = dr Upvote 0
Unfortunately your example does not work. Try with Samsung-S4(5.01) and HTC-One-A9(6.01). It only works when I use this code. Code: Copy Dim dr As GradientDrawable dr.Initialize("TR_BL", Array As Int(Colors.Red, Colors.Red)) dr.CornerRadius = Panel1.Width / 2 Panel1.Background = dr