iOS Question TextField - How can I limit ?

cooperlegend

Active Member
Licensed User
Longtime User
I have tried using TextChanged as below (This worked fine in B4A)

B4X:
Sub txtPasscode_TextChanged (OldText As String, NewText As String)
    If NewText.Length > 6 Then
        txtPasscode.Text = OldText
    End If
End Sub

But this doesn't work in b4i. Currently I have to truncate using EndEdit, but I would prefer to limit the user to inputting no more than 6 characters.

Any Ideas?
 

cooperlegend

Active Member
Licensed User
Longtime User
That almost works, it at first allows and shows the 7th character, then when you enter another character it then truncates back to 6 (correctly) ?!??
Quite strange...
 
Upvote 0
Top