Android Question CreateItem height

kohle

Active Member
Licensed User
Longtime User
Hi,
I am adding a B4XView (panel) to a xcustomlistview with a height of 18dip.
(See Code)
On celphones it looks good, but not on my samsung tablets, the height
seems to small. I thought the Autoscale in the designer would do it
and adapt to 18dip.


B4X:
Sub CreateItem(str As String, str2 As String) As B4XView
    Dim p As B4XView = xui.CreatePanel("")

    p.SetLayoutAnimated(0, 0, 0, clv_main.AsView.Width, 18dip)
    p.Color = Colors.Black
    p.LoadLayout("item_main")
    lblDateTime.Text = str
    lblAlarm.Text = str2
    
    Return p
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
Autoscale does not change the Size of a Layout.
You need to adapt it by yourself on Tablets. Check the device size and set a higher height on Tablets.
 
Upvote 0
Top