Android Question customelistview with spotlight menu

HAH

Well-Known Member
Licensed User
hello all
i have created items dynamically in a customelistview and in every cell of the customistview there is a button,that button shows the spotlight menu
my problems are:

1- the menu appears only when i presses the three bottom cells in the cusomelistview but in the upper cells it appears out of the device width which means i cant see it.

2- when the menu appear it takes only in formation of the last bottom customelistview cell and when i press the button in any cell at shows the information the token from last bottom cell.

my code is
B4X:
Sub Globals
    Private splight As SpotLight
    Private btnsubmnu As Button
End Sub

Sub CreateList(  rownumber As Int, layout As Int, Width As Int, Height As Int) As Panel

    Dim p As Panel

    p.Initialize("")
    Activity.AddView(p, 0, 0, Width, Height)
    p.LoadLayout("cellitems")' the layout that contain (btnsubmnu) button
    Dim icon As Bitmap
    icon.Initialize(File.DirAssets,"b4a_180.png")
    splight.Initialize(Me,"splight",7%y,False,False,True,btnsubmnu,Activity)
    splight.additem(rownumber,Colors.Black,18,icon)
    splight.additem("Refresh",Colors.Black,18,Null)
    splight.additem("Compose",Colors.Black,18,Null)
    p.RemoveView
    Return p
End Sub

Sub btnsubmnu_Click
    splight.show
End Sub
 
Top