Android Question xCustomListView or B4A 8.0's bug?

Riddle Ling

Member
Licensed User
I try to change the height of xCustomListView in Runtime,
But the xCustomListView's ScrollViewHeight display is abnormal.

as shown in the picture (xCustomListView's scrollView cannot display all items) :
Screenshot_20180331-112952.png

I updated B4A to version 8.0 a few days ago, but it seems to be normal before.
Now I try to use the following code:

B4X:
clv1.sv.Height = 40dip * 20
But it doesn't work.
How can I change the ScrollViewHeight?

I upload my test code, Please help me, thank!
 

Attachments

  • xCustomListViewTest.zip
    10.3 KB · Views: 165
Last edited:

Riddle Ling

Member
Licensed User
You need to set both heights:
clv1.GetBase.Height = 240dip
clv1.sv.Height = 240dip

Thank you very much!

I try this post's code:
https://www.b4x.com/android/forum/t...wheight-of-xcustomlistview.91296/#post-576922

Now it is work!

code update to:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("1")
   
    For i = 20 To 0 Step -1
        clv1.Add(CreateListItem($"Item #${i}"$, clv1.AsView.Width, 40dip), $"Item #${i}"$)
        Log(i & $": Item #${i}"$)
    Next
   
    clv1.GetBase.Height = 240dip
    clv1.sv.Height = 240dip
    clv1.sv.ScrollViewInnerPanel.Height = (21 * 42dip) + 2dip
End Sub
 
Upvote 0
Top