Hi all,
I'm adding custom layouts to a xCustomListView (B4A). They have 90 dips as height and I use this code:
But I have different results in vertical spacing with different devices.
In the picture you see a Nexus 4", a PixelXL (6.3") and a Tab (9.9").
Pixel XL in the middle looks as I want, while I should use a height of 80 or 120 to have the same appearance on Nexus and Tab.
Brainstorming on DeviceScale, Root.height etc I'm not able to find the correct formula so that the vertical spacing is correct on any device.
Any help ?
I'm adding custom layouts to a xCustomListView (B4A). They have 90 dips as height and I use this code:
B4X:
for x=1 to ...
ClvLocList.Add(CreateListItem(x, ClvLocList.AsView.Width, 90dip),p.loc)
Next
...
...
Private Sub CreateListItem(Text As String, Width As Int, Height As Int) As B4XView
Text=Text
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, Width, Height)
p.LoadLayout("loclistrow")
Return p
End Sub
But I have different results in vertical spacing with different devices.
In the picture you see a Nexus 4", a PixelXL (6.3") and a Tab (9.9").
Pixel XL in the middle looks as I want, while I should use a height of 80 or 120 to have the same appearance on Nexus and Tab.
Brainstorming on DeviceScale, Root.height etc I'm not able to find the correct formula so that the vertical spacing is correct on any device.
Any help ?