Android Example [B4X] AS PopupMenu with icons


(53) mage.png
(54) mage.png


B4X:
Private Sub ShowMenu
    
    aspm_Main.Initialize(Root,Me,"aspm_Main")
 
    aspm_Main.MenuCornerRadius = 10dip
    aspm_Main.ItemLabelProperties.TextAlignment_Horizontal = aspm_Main.OrientationHorizontal_LEFT
    aspm_Main.ItemLabelProperties.LeftRightPadding = 10dip
 
    aspm_Main.IconProperties.HorizontalAlignment = aspm_Main.OrientationHorizontal_RIGHT
 
    aspm_Main.AddMenuItemWithIcon("Item #1",aspm_Main.FontToBitmap(Chr(0xE3C9),True,20,xui.Color_White),"Item1")
    aspm_Main.AddMenuItemWithIcon("Item #2",aspm_Main.FontToBitmap(Chr(0xE192),True,20,xui.Color_White),"Item2")
 
    aspm_Main.ItemLabelProperties.BackgroundColor = xui.Color_ARGB(200,0,0,0)'black
 
    aspm_Main.OpenMenuAdvanced(Root.Width/2 - 200dip/2,Root.Height/2 - aspm_Main.MenuHeight/2,200dip)

    Wait For aspm_Main_ItemClicked(Index As Int,Tag As Object)
    
    Select Tag.As(String)
        Case "Item1"
            
        Case "Item2"

    End Select
    
End Sub
 

Attachments

  • AS PopupMenu with Icons.zip
    177.4 KB · Views: 275
Top