Android Question Customlistview and amount of items displayed inconsistancy

kostefar

Active Member
Licensed User
Longtime User
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:

upload_2017-7-28_21-41-48.png



That´s 4 and a half ish items.

Here´s from a phone with resolution 480*800:

upload_2017-7-28_21-43-10.png


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!
 

Attachments

  • upload_2017-7-28_21-38-51.png
    upload_2017-7-28_21-38-51.png
    20.5 KB · Views: 177

kostefar

Active Member
Licensed User
Longtime User
I just realized that things shouldn´t really look the same on any resolution device when it comes to lists. Afterall you want to have more text on a device with a larger surface. Hence, please consider this thread closed.
 
Upvote 0
Top