I'm creating a B4X Custom View
I want to set the background of a label to the BitmapDrawable set in the properties of the Base Background in the Designer
The following code results in an empty background for the label, while other properties are correctly passed (like Text)
B4X:
'Base type must be Object
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
mBase = Base
Lbl_button.Initialize("")
Lbl_button.Background = Lbl.Background
...
Public Sub getBaseDrawable As Object
Dim BaseDrawable As Object
#If B4A
Dim pnl As Panel = mBase
BaseDrawable = pnl.Background
#Else If B4J
Dim pn As Pane = mBase
BaseDrawable = pn.Snapshot
#End If
Return BaseDrawable
End Sub
Since your trying to create a B4X CV, it should work not only with B4A but at least even with B4J and/or B4i.
1 - I don't know-have B4i
2 - Pane (B4J) does not provide its drawable, then in the code above the property will return a B4J Image.