I think you need to change the size of Title Font of this thread!
As far as I know, there is no way to do it with a simple EditText, since the [Hint] underlying object is just a string and is shown with the size defined for the text.
I think you need to change the size of Title Font of this thread!
As far as I know, there is no way to do it with a simple EditText, since the [Hint] underlying object is just a string and is shown with the size defined for the text.
As far as I know, there is no way to do it with a simple EditText, since the [Hint] underlying object is just a string and is shown with the size defined for the text.
Sorry for the wrong answer. I read it incorrectly. You can change the hint text size as below.
B4X:
Dim jo As JavaObject = edittext
Dim csb As CSBuilder
jo.RunMethod("setHint",Array(csb.Initialize.Size(30).Append("Test ").PopAll.Size(20).Append("hint").PopAll))
That's just what I meant. EditTex does not have an exposed native method for resizing the Hint.
I assumed it could be done via Java, which I ignore from "J" to "A".
Based on that answer, using pure B4A, we can use the TextChanged event.
B4X:
Sub Globals
Private EditText1 As EditText
Private Size As Float
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
Size=EditText1.TextSize 'Original Size Defined In Designer
SetHintSize(EditText1)
End Sub
Sub EditText1_TextChanged (Old As String, New As String)
If (Old.Trim="") <> (New.Trim="") Then
SetHintSize(EditText1)
End If
End Sub
Sub SetHintSize(edt As EditText)
edt.HintColor=Colors.Red
edt.TextColor=Colors.Blue
If edt.Text.Trim()="" Then
edt.TextSize=Size * .60
Else
edt.TextSize=Size
End If
End Sub
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.