Android Question place a panel over an item in customlistview


Well-Known Member
Licensed User
i am trying to place a menu panel over customlistview item something like popup menu.

i tried to work in on itemclick event like following

Private Sub clv_ItemClick (Index As Int, Value As Object)
Dim itemgetoff As Int
Dim clvitem As CLVItem
'First I get the rawList Item
clvitem = clv.GetRawListItem(Index)
' then i set the popmenu left position
popupMenu.AsView.Left = clvitem.Panel.Width - 300dip
' then i check if the clv scroll content height is bigger than clv height then
' i set the itemgetoff variable to globaloffset
' that i have set based on scroll change event
If > clv.AsView.Height Then
        itemgetoff = globaloffset
        itemgetoff = 0
End If

' then i set the popupmenu top position to be showin over the clicked item
popupMenu.AsView.Top = clvitem.Offset + (clvitem.Panel.Height) - itemgetoff

End Sub

but when there is too many items or i resize the Xclv when keyboard showing the popupmeu top position changed to unexpected position and some times disappeard .
any idea what i am doing wrong ?
The screen is small enough that it isn't really worth the effort to fight with this. Simply use B4XDialog and show whatever you like in the center of the screen.