B4J Question ListView: Node Height?

LWGShane

Well-Known Member
Licensed User
Longtime User
I have a ListView and a Button that has a height of 500. I want to add the Button to the ListView however, when I do the Button isn't 500px high.

Is there a solution to making the ListView rows fit to the item's height?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm testing it with this code and it seems to work properly:
B4X:
Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   MainForm.RootPane.LoadLayout("1") 'Load the layout file.
   MainForm.Show
   Dim b As Button
   b.Initialize("")
   b.SetLayoutAnimated(0, 0, 0, 300, 300)
   ListView1.Items.Add(b)
   Dim b As Button
   b.Initialize("")
   b.SetLayoutAnimated(0, 0, 0, 300, 500)
   ListView1.Items.Add(b)
End Sub
 
Upvote 0

jmon

Well-Known Member
Licensed User
Longtime User
when I do the Button isn't 500px high
You could force the Min Height to be 500px:
B4X:
Dim jo as JavaObject = btn
jo.RunMethod("setMinHeight", Array(500.0))
 
Upvote 0
Top