vecchiounno Member Licensed User Oct 30, 2023 #1 how can I assign GradientDrawable to a Label from code? Dim gd As GradientDrawable Dim clr(2) As Int clr(0)=Colors.Blue clr(1)=Colors.Yellow gd.Initialize("TOP_BOTTOM",clr) gd.CornerRadius=50dip Label1.Color=gd Click to expand... Error: java.lang.NumberFormatException: For input string: "(GradientDrawable) android.graphics.drawable.GradientDrawable@c4e49ff" tks
how can I assign GradientDrawable to a Label from code? Dim gd As GradientDrawable Dim clr(2) As Int clr(0)=Colors.Blue clr(1)=Colors.Yellow gd.Initialize("TOP_BOTTOM",clr) gd.CornerRadius=50dip Label1.Color=gd Click to expand... Error: java.lang.NumberFormatException: For input string: "(GradientDrawable) android.graphics.drawable.GradientDrawable@c4e49ff" tks
klaus Expert Licensed User Longtime User Oct 30, 2023 #2 Label1.Color=gd is wrong. Replace it by: Label1.Background = gd Upvote 0
vecchiounno Member Licensed User Oct 30, 2023 #3 klaus said: Label1.Color=gd is wrong. Replace it by: Label1.Background = gd Click to expand... yes but my Label1 is a B4XView not a Label... Upvote 0
klaus said: Label1.Color=gd is wrong. Replace it by: Label1.Background = gd Click to expand... yes but my Label1 is a B4XView not a Label...
jahswant Well-Known Member Licensed User Longtime User Oct 30, 2023 #4 Label1.As(Label).Background = gd Last edited: Oct 31, 2023 Upvote 1
vecchiounno Member Licensed User Oct 30, 2023 #5 jahswant said: Label1.As(Label).Background = gd Click to expand... yesssss perfect tks Last edited: Nov 1, 2023 Upvote 0