Android Question [solved] CustomListView - different divider thickness on phone and tablet

ThePuiu

Active Member
Licensed User
Longtime User
I tried to simulate a menu using a CustomListView.
I set the divider thickness to 2 (dip?) On the 10 inch tablet the divider looks perfect, but on the phones it is much thicker (see the attached pictures)
What can be done to keep the distance constant? It is not a problem of functionality as much as a design ... Used code:
B4X:
Sub CreateMenu(img As String, txt As String, logout As Int) As Panel
    Dim p As Panel
    p.Initialize("")
    p.Tag = logout
    p.SetLayout(0, 0, 300dip, 52dip)
    p.LoadLayout("itemMenu")
        
    LabelImg.Text = img
    LabelMeniu.Text = txt

    Return p
End Sub
 

Attachments

  • 4inch.png
    44.1 KB · Views: 145
  • 6inch.png
    21.1 KB · Views: 146
  • 10inch.png
    13.2 KB · Views: 134

ThePuiu

Active Member
Licensed User
Longtime User
after eliminating the AutoScaleAll command and changing the height of the items in the code, the distance between items is constant on all resolutions! Thanks for the idea!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…