iOS Question Change text size and color of listview

Alessandra Pellegri

Active Member
Licensed User
Longtime User
I am porting my project from B4A to B4I.
In B4A I use:
B4X:
     ListView1.SingleLineLayout.Label.TextSize=convertFromDp(20)
     ListView1.SingleLineLayout.Label.TextColor=Colors.Black 

Sub convertFromDp(input As Int)  '<<- Found here on B4A forum
   Dim scale As Float
   scale = GetDeviceLayoutValues.scale
   Return ((input - 0.5) / scale)
End Sub

The issue is that I cannot find in B4I any property of ListView similar to .Label.TextSize and .Label.TextColor.

How can i do ?

Thank you
 

Alessandra Pellegri

Active Member
Licensed User
Longtime User
I wouldn't use this code in B4A. It is wrong.
Why is it wrong in B for Android ? It seems to work nice mantaining same font dimensions on all devices.

See TableView tutorial: https://www.b4x.com/android/forum/threads/tableview-b4i-listview.50403/
It shows how you can change the font size.
Ok, thank you.
I didn't know that listview don't exist in IOS and I used Bal2Bil.exe to convert my project into Basic for IOS and it converted "listviews" in "panels". I didn't notice it and I had errors in compiling.
 
Upvote 0
Top