ListView with full text?

susu

Well-Known Member
Licensed User
Longtime User
I use a 2 lines ListView to display the content. How to make second line display full text? I try below code but it doesn't work:

B4X:
ListView1.TwoLinesLayout.ItemHeight = 100%y

this code doesn't work too:

B4X:
ContentLabel = ListView1.TwoLinesLayout.SecondLabel
ContentLabel.Height = 100%y

attachment.php
 

Attachments

  • help.jpg
    help.jpg
    47.4 KB · Views: 998

Erel

B4X founder
Staff member
Licensed User
Longtime User
Something like:
B4X:
Sub Globals
    Dim lv As ListView
End Sub 

Sub Activity_Create(FirstTime As Boolean)
    lv.Initialize("lv")
    activity.AddView(lv, 0, 0, 100%x, 100%y)
    lv.TwoLinesLayout.ItemHeight = 140dip
    lv.TwoLinesLayout.SecondLabel.Height = 120dip
    For i = 1 To 100
        lv.AddTwoLines("Item #" & i, "This is a very long text" & CRLF & "This is a very long text" & CRLF & "This is a very long text" & CRLF _ 
             & "This is a very long text" & CRLF & "This is a very long text" & CRLF)
    Next
End Sub

20101219.png
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
Thanks Erel.

But:
1. I don't want to break the content to many lines.
2. The code:
lv.TwoLinesLayout.SecondLabel.Height = 120dip
is useless because I can not guess how long the line will be.

Still looking for another way.
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
Still looking for another solution....
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
Can I use ScrollView to display full text?
 
Upvote 0
Top