Is it possible to add pictures in the CustomListView class
In the Example of CustomListView class, there are no pictures (bitmaps)
If it possible, how?
Yes, you can add pictures. CLV is a very flexible object.
Just keep in mind that each CLV's item is a panel, so if you add an ImageView to your panel you'll see it when that panel is displayed (as part of the CLV).
An easy way to add elements to CLV's items is using the Designer to prepare a layout made up of all the items you want to show on a panel, then use that layout on the panel you add to the CLV. Different items could refer to different layouts.
Thanks, it works
I add an Imageview in designer and change the code in the example like this
B4X:
Sub CreateListItem(sImage As String, Text As String, Width As Int, Height As Int) As Panel
Dim p As Panel
p.Initialize("")
p.SetLayout(0, 0, Width, Height)
p.LoadLayout("CellItem")
ImageView1.SetBackgroundImage(LoadBitmapResize(spathRot, sImage, ImageView1.Width, ImageView1.Height, True))
Label1.Text = Text
Return p
End Sub
After changing the method like the example https://www.b4x.com/android/forum/threads/87930 that appear to work
but Clv1_VisibleRangeChanged event not raised. By making a call to the event, I see the first cards.
What can I have missed?
I use:
Windows 10
jdk1.8.0_152
Android-27
B4A 7.80
Galaxy S8+
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.