Android Question [Solved]Change customlistview to bold

Ricky D

Well-Known Member
Licensed User
Longtime User
I don't see a way to make my text lines be bold. I can set the color. Is there a way to make them bold?
 

DonManfred

Expert
Licensed User
Longtime User
A CLV is the base Object. It can not "be bold".
Add a Textobject to the CLV and set the Texts Typeface to be Bold.
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
I'll have a look but I'd rather keep it simple I'll write a test app to see if listview will allow me to do it
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Are you speaking of CustomListView or ListView.

For CustomListView you got the answer from DonManfred.

In ListView for single line use:
ListView1.SingleLineLayout.Label.Typeface = Typeface.DEFAULT_BOLD
The same principle is valid for the other layouts.
But, be aware that these settings are valid for all lines with the same layout (SingleLineLAyout,TwoLinesLayout or TwoLinesAndBitmapLayout).
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
Are you speaking of CustomListView or ListView.

For CustomListView you got the answer from DonManfred.

In ListView for single line use:
ListView1.SingleLineLayout.Label.Typeface = Typeface.DEFAULT_BOLD
The same principle is valid for the other layouts.
But, be aware that these settings are valid for all lines with the same layout (SingleLineLAyout,TwoLinesLayout or TwoLinesAndBitmapLayout).
I have found that the listview doesn't move up the screen when the keyboard appears. I'll try customlistview but I don't know how to tie csbuilder into it or about a text object to add to it
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
This is a slightly modified example of the CLV .. it is using the class module .. not the CLV Lib.
You can pass a parameter should you want text to be Bold or not.

There are two methods to insert Text to the CLV's ...

clv1.AddTextItem ... (this adds a panel containing a Label with your text)
Study the subs 'AddTextItem' & 'InsertAtTextItem' within the CLV class module

clv2.Add(CreateListItem ... (this adds a panel containing whatever views you wish to add ) this can be done via the designer.
The example loads layout "CellItem" which holds a Label, Button & Checkbox.
Study the sub 'CreateListItem' in the Main Module.
 

Attachments

  • BoldCLV Example.zip
    15.3 KB · Views: 173
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
This is a slightly modified example of the CLV .. it is using the class module .. not the CLV Lib.
You can pass a parameter should you want text to be Bold or not.

There are two methods to insert Text to the CLV's ...

clv1.AddTextItem ... (this adds a panel containing a Label with your text)
Study the subs 'AddTextItem' & 'InsertAtTextItem' within the CLV class module

clv2.Add(CreateListItem ... (this adds a panel containing whatever views you wish to add ) this can be done via the designer.
The example loads layout "CellItem" which holds a Label, Button & Checkbox.
Study the sub 'CreateListItem' in the Main Module.
Thanks a lot this fixed it! I recompiled your version to the library and changed my code to include the bold on my autocompletes I have.
 
Upvote 0
Top