iOS Question Change font of tableview?

techknight

Well-Known Member
Licensed User
Longtime User
Is it possible to change the font used on a TableView?

I would like to use FontAwesome in the text on my tableview.
 

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
You could add the text to the Tableview which returns a TableCell

TableCell.text is an Attributed string which will accept a CSBuilder.

so the following should work.

(I didn't compile)

e.g.
B4X:
Private cs As CSBuilder
cs.Initialize.Font(Font.CreateFontAwesome(10)).Append(Chr(0xF087)).popall
Private tc As TableCell = TableView1.AddSingleLine("")
tc.text = cs
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
I ended up doing something a little different

B4X:
        Dim TS As TableCell
        DeviceInfo.Initialize
        DeviceInfo = FoundDevices.Get(Key)
        TS = tv1.AddTwoLines("","")
        TS.Tag = DeviceInfo
        Dim SignalBars, DeviceText As AttributedString
        DeviceText.Initialize(DeviceInfo.Name, Font.CreateNew(21), Colors.Black)
        SignalBars.Initialize(GetBars(CalculateSignalLevel(DeviceInfo.RSSI, 5)), Font.CreateNew2("FontAwesome5ProSolid", 19), Colors.Gray)
        TS.DetailText = SignalBars
        TS.Text = DeviceText
 
Upvote 0
Top