iOS Question xCustomListView - items that are wider than the list in vertical mode

Alexander Stolte

Expert
Licensed User
Longtime User
I would like to use the xCustomListView in vertical and horizontal mode at the same time. But the items have a white area where the view ends. How can I get the CustomListView to use the ConentWidth completely without this white area?

Example project is attached
B4X:
    For i = 0 To 100
       
        Dim xpnl As B4XView = xui.CreatePanel("")
        xpnl.SetLayoutAnimated(0,0,0,Root.Width*2,200dip)
        xpnl.Color = xui.Color_ARGB(255,Rnd(0,256),Rnd(0,256),Rnd(0,256))
        CustomListView1.Add(xpnl,"")
       
    Next
   
    CustomListView1.sv.ScrollViewContentWidth = Root.Width*2
    CustomListView1.sv.ScrollViewInnerPanel.Width = Root.Width*2

(55) mage.png
 

Attachments

  • Example Project.zip
    3.6 KB · Views: 61

Alexander Stolte

Expert
Licensed User
Longtime User
I found the solution in the clv class.

When you add an item, a panel is created internally which is then added to the scrollist. The panel that we pass to the ".Add" function is then added to this panel.
So i need to resize this internal panel too:
B4X:
    For i = 0 To CustomListView1.Size -1
        
        CustomListView1.GetPanel(i).Parent.Width = Root.Width*2
        
    Next
 
Upvote 0
Top