Hi Guys
I have a Sub that I call using:
My sub is:
Althoug this gives no error and it works as expected, I get a warning...
Font1 is a typeface object and Header is a LabelView.
I just wish to understand why...
I have a Sub that I call using:
B4X:
Header2.TextSize = SetTextSize("Advanced Player",Font2,Header2)
My sub is:
B4X:
Private Sub SetTextSize(text As String,Font As String, control As View) As Double
Dim cv As Canvas
cv.Initialize(Activity)
Dim FSize As Double
FSize = 1
Do Until cv.MeasureStringHeight(text,Font1,FSize) = control.Height
FSize = FSize + 1
Loop
FSize = Floor(FSize * 0.7)
Log(FSize)
Return FSize
End Sub
Althoug this gives no error and it works as expected, I get a warning...
B4X:
Object converted to String. This is probably a programming mistake.
Font1 is a typeface object and Header is a LabelView.
I just wish to understand why...