i facing a label height problem,here is my code:
first time get in the message page, all show in perfect.
screenshot below:
but after that, all going wrong.
screenshot below:
how to solve this problem. I'm totally no idea to solve it.
please help me.
Thanks!
B4X:
Sub CreateListItem(left_right_status As Int,Text1 As String,Text2 As String, value As String)
Dim p As Panel
Dim p1 As Panel
Dim lbl1_left As Label
Dim lbl2_left As Label
lbl1_left.Initialize("")
lbl2_left.Initialize("")
p.Initialize("")
p1.Initialize("")
If left_right_status = 1 Then
p1.SetBorder(0dip, Colors.Red, 5dip)
lbl1_left.Font = Font.DEFAULT_BOLD
lbl1_left.TextColor=Colors.Black
lbl1_left.Font = Font.CreateNew(12)
lbl2_left.TextColor=Colors.White
lbl2_left.Font = Font.CreateNew(16)
p.Color=Colors.Transparent
p1.Color=Colors.ARGB(255,58,155,250)
lbl2_left.Multiline=True
lbl1_left.Text = Text1
lbl2_left.Text = Text2
p1.AddView(lbl1_left,2%x,0%y,79%x,4%y)
p1.AddView(lbl2_left,2%x,4%y,79%x,10%y)
lbl1_left.SizeToFit
lbl2_left.SizeToFit
p.AddView(p1,2%x,0,80%x,lbl1_left.Height+lbl2_left.Height+5dip)
clv_msg.Add(p,lbl1_left.Height+lbl2_left.Height+5dip,"")
Else If left_right_status = 0 Then
p1.SetBorder(0dip, Colors.Red, 5dip)
lbl1_left.Font = Font.DEFAULT_BOLD
lbl1_left.TextColor=Colors.Black
lbl1_left.Font = Font.CreateNew(12)
lbl2_left.TextColor=Colors.White
lbl2_left.Font = Font.CreateNew(16)
p.Color=Colors.Transparent
p1.Color=Colors.ARGB(255,3,156,15)
lbl2_left.Multiline=True
lbl1_left.Text = Text1
lbl2_left.Text = Text2
p1.AddView(lbl1_left,2%x,0%y,74%x,4%y)
p1.AddView(lbl2_left,2%x,4%y,74%x,10%y)
lbl1_left.SizeToFit
lbl2_left.SizeToFit
p.AddView(p1,20%x,0%y,78%x,lbl1_left.Height+lbl2_left.Height+5dip)
clv_msg.Add(p,lbl1_left.Height+lbl2_left.Height+5dip,"")
End If
End Sub
screenshot below:
but after that, all going wrong.
screenshot below:
how to solve this problem. I'm totally no idea to solve it.
please help me.
Thanks!