B4J Question Add Images to Segmented Control Possible?

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can add a node to each button:
B4X:
Sub SetGraphic(SegmentedButton As SegmentedButton, Index As Int, Node As Node)
Dim ToggleButton As JavaObject = SegmentedButton
ToggleButton = ToggleButton.RunMethodJO("getButtons", Null).RunMethod("get", Array(Index)) 
ToggleButton.RunMethod("setGraphic", Array(Node))
End Sub
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
You can add a node to each button:
B4X:
Sub SetGraphic(SegmentedButton As SegmentedButton, Index As Int, Node As Node)
Dim ToggleButton As JavaObject = SegmentedButton
ToggleButton = ToggleButton.RunMethodJO("getButtons", Null).RunMethod("get", Array(Index))
ToggleButton.RunMethod("setGraphic", Array(Node))
End Sub
Perfect!!! Thanks a million.
 
Upvote 0
Top