Dear All,
The number of items displayed on devices with different resolutions are not the same in a customlistview, despite the usage of dip.
Screenshots below, first of a device with resolution 768*1280:
That´s 4 and a half ish items.
Here´s from a phone with resolution 480*800:
That´s exactly 4 items. Code:
and:
Horizontally there are no problems, so I´ve also cut part of the images off to the left side.
Any idea how to get things right?
Thanks in advance!
The number of items displayed on devices with different resolutions are not the same in a customlistview, despite the usage of dip.
Screenshots below, first of a device with resolution 768*1280:
That´s 4 and a half ish items.
Here´s from a phone with resolution 480*800:
That´s exactly 4 items. Code:
B4X:
headersClv.Add(CreateListitem_Headers(m,headersClv.AsView.Width,105dip), 105dip, m)
and:
B4X:
Sub CreateListitem_Headers(listmap As Map , itemWidth As Int, itemheight As Int) As Panel
Dim p As Panel
Dim tl As Fivelines = listmap.Get("tl")
p.Initialize("")
Activity.AddView(p, 0, 0, itemWidth, itemheight)
p.LoadLayout("Headeritem")
p.RemoveView
HeaderFromLabel.Text = tl.msg_Sender
HeaderSubjectLabel.Text = tl.msg_Subject
HeaderTimeLabel.Text = listmap.Get("timedisp")
HeaderTimeLabel.Gravity = Gravity.right
HeaderImgPanel.Width = HeaderImage.Width
HeaderImgPanel.height = HeaderImage.height
HeaderImage.Color = Colors.Transparent
HeaderImage.Bitmap = listmap.Get("bitmap")
Return p
End Sub
Horizontally there are no problems, so I´ve also cut part of the images off to the left side.
Any idea how to get things right?
Thanks in advance!