Does anyone know of examples of an xCLV with auto sizing of added panels.
I have panels with two labels that get filled with text and then both labels get added to the xCLV. The problem is each time the text might be of different lengths but the panel size stays the same and I have either a big gap between items in the xCLV or text that is cut off.
Private Sub CreateItem(rd As RecordData) As B4XView
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, Root.Width, 60dip)
p.LoadLayout("Item")
'labels will point to the last loaded views with the set name.
lblAlbum.Text = rd.AlbumName
lblArtist.Text = rd.ArtistName
p.SetLayoutAnimated(0, 0, 0, Root.Width, lblAlbum.Height + lblArtist.Height)
Return p
End Sub
Private Sub CreateItem(rd As RecordData) As B4XView
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, Root.Width, 60dip)
p.LoadLayout("Item")
'labels will point to the last loaded views with the set name.
lblAlbum.Text = rd.AlbumName
lblArtist.Text = rd.ArtistName
p.SetLayoutAnimated(0, 0, 0, Root.Width, lblAlbum.Height + lblArtist.Height)
Return p
End Sub
It does change the height but it changes them all the same. It's not taking into account the text that is in the labels so each panel is still the same size.
Routines to adjust a label to fit its text/adjust text size to fit a label: * SizeToFitWidth - given a width (and using the label's font), adjust the label's height * SizeToFitHeight - given a height (and using the label's font), adjust the label's width * SizeFontToFit - given some text for the...
Hi, I have a stack of views: imageview, label, and a few checkboxes that load its content dynamically (check the picture), how I can align them vertically ? avoiding blank spaces ? shrinking the height of each