iOS Question Change text size and color of listview

Discussion in 'iOS Questions' started by Alessandra Pellegri, Jul 31, 2015.

  1. Alessandra Pellegri

    Alessandra Pellegri Active Member Licensed User

    I am porting my project from B4A to B4I.
    In B4A I use:
    Code:
    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
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Alessandra Pellegri

    Alessandra Pellegri Active Member Licensed User

    Why is it wrong in B for Android ? It seems to work nice mantaining same font dimensions on all devices.

    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.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Text size is always measured in device independent pixels (dips). You just need to set Label.TextSize = 20 and it will look the same on all devices.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice