Android Question ListView help is needed

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
hi,
i'm using listview with 2 lines and icon
is there a way to change font size for top line ?

thanks
 

Mahares

Expert
Licensed User
Longtime User
is there a way to change font size for top line ?
Yes. Use csbuilder to construct the first line:
B4X:
Dim cs As CSBuilder
        cs.Initialize.Size(30).Color(Colors.Red).Typeface(Typeface.CreateNew(Typeface.DEFAULT,Typeface.STYLE_ITALIC)).Append("My First Line").PopAll
        MyLv.AddTwoLinesAndBitmap(cs, then 2nd line, then bitmap)
It is recommended these days to use xClv instead of ListView.
Can you correct your thread title from listvew to ListView although it is spelled correctly in the body of your post.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
B4X:
Dim Label1 As Label
Label1 = ListView1.TwoLinesLayout.SecondLabel
Label1.TextSize = 20
Label1.TextColor = Colors.Green
Label1.TypeFace=TypeFace.....
 
Last edited:
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
thanks
saw this earlier but never got how to implement it
nothing worked

will it be possible to have a short example ?
The example is what I have attached above.
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
will it be possible to have a short example ?

B4X:
Dim Label1 As Label
Label1 = ListView1.TwoLinesLayout.SecondLabel
Label1.TextSize = 20
...

Joking... see attached a small project.
The top one is a ListView (not recomended). The bottom one is a customListView
 

Attachments

  • ListView.zip
    15.3 KB · Views: 128
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Yes. Use csbuilder to construct the first line:
B4X:
Dim cs As CSBuilder
        cs.Initialize.Size(30).Color(Colors.Red).Typeface(Typeface.CreateNew(Typeface.DEFAULT,Typeface.STYLE_ITALIC)).Append("My First Line").PopAll
        MyLv.AddTwoLinesAndBitmap(cs, then 2nd line, then bitmap)
It is recommended these days to use xClv instead of ListView.
Can you correct your thread title from listvew to ListView although it is spelled correctly in the body of your post.
thanks for your sample
one thing i don't get - how to add more lines ?
just use initialize again ?
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Zeev, you are wasting your time with ListView. There isn't a single good reason to use it.

Switch to xCustomListView.
thanks,
understood - the problem is that it is an existing working app and i didn't want to change what's working fine
but i will consider this
thanks
 
Upvote 0
Top