I am using a tabhost and load a layout-file using AddTabWithIcon.
Now I need to set by code the GradientDrawable of the layout-file. I could do it directly in the designer if it was a standard GradientDrawable but I am using RadialGradient which can only be set by code.
PS: I guess I could use AddTabWithIcon2 and setting by code the GradientDrawable of the panel loaded as a view but I prefer not since I would need to re-write a lot of code.
So the question, is it possible to set by code the GradientDrawable of a layout-file? Probably I have overlooked something but I cannot find it.
Here is my code which doesn't give the expected result:
Now I need to set by code the GradientDrawable of the layout-file. I could do it directly in the designer if it was a standard GradientDrawable but I am using RadialGradient which can only be set by code.
PS: I guess I could use AddTabWithIcon2 and setting by code the GradientDrawable of the panel loaded as a view but I prefer not since I would need to re-write a lot of code.
So the question, is it possible to set by code the GradientDrawable of a layout-file? Probably I have overlooked something but I cannot find it.
Here is my code which doesn't give the expected result:
B4X:
tabEPG.AddTabWithIcon("1",bmp1, bmp2,"page1.bal")
tabEPG.AddTabWithIcon("2",bmp3, bmp4,"page2.bal")
tabEPG.AddTabWithIcon("3",bmp5, bmp6,"page3.bal")
Dim GD_BG As GradientDrawable
GD_BG.Initialize("TOP_BOTTOM", Array As Int(Colors.RGB(102,102,102), Colors.RGB(26,26,26)))
Activity.Background = GD_BG
GeneralCode.SetRadialGradient(GD_BG, Activity.Height/2)
'Activity.Background = GD_BG 'wrong activity
'tabEPG.Background= GD_BG
Last edited: