You can use this code to add an ImageView to a button:
B4X:
Sub SetGraphic(Btn As Button, Graphic As Node)
Dim jo As JavaObject = Btn
jo.RunMethod("setGraphic", Array(Graphic))
End Sub
Dim iv As ImageView
iv.Initialize("")
iv.SetImage(fx.LoadImage(File.DirAssets, "EffectNone.png"))
SetGraphic(button1, iv)
You can use this code to add an ImageView to a button:
B4X:
Sub SetGraphic(Btn As Button, Graphic As Node)
Dim jo As JavaObject = Btn
jo.RunMethod("setGraphic", Array(Graphic))
End Sub
Dim iv As ImageView
iv.Initialize("")
iv.SetImage(fx.LoadImage(File.DirAssets, "EffectNone.png"))
SetGraphic(button1, iv)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.