Android Question ListView ItemHeight

ronovar

Active Member
Licensed User
Longtime User
I have ListView that holds 12 items....i defined item height to be 37dip.

Problem is when i scroll last item in scolled page bottom it moves whole ListView top and scrolling first item in scrolled page it scrolls whole ListView bottom...how to fix ListView item to not scroll whole only items?

I found that i need to add header and footer because it not exists on top and bottom of listview..so that this is the problem why is scrolling top or bottom because of missing top and bottom divider (1dip)

Here is code that you can see when you scrolling whole ListView is moving up or down.

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim lv As ListView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")

    lv.Initialize("lv")
   
    lv.SingleLineLayout.ItemHeight = 37dip

    For i=0 To 12
        lv.AddSingleLine2("Item #"&(i+1), i+1)
    Next
   
    Activity.AddView(lv, 0, 10%y, 300dip, 229dip)
End Sub

How to fix this?
 

ronovar

Active Member
Licensed User
Longtime User
See this picture above Item #1 is missing divider...how to set it up?
 

Attachments

  • 1.png
    28.5 KB · Views: 403
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…