How to set letter spacing of UITextField

前端 未结 7 1069
[愿得一人]
[愿得一人] 2021-01-30 12:55

I have an app in which the user has to type a four digit pin code. All digits have to be at a set distance from each other.

Is there a way to do this if the PinTex

7条回答
  •  情书的邮戳
    2021-01-30 13:17

    Not really sure about any other solution instead of using attributed string.

    But for the notification part, you can set the textFields delegate to UIView and define below method in the view.

    - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string; 
    

    The above method is called every time the text entered in the text field changes.

提交回复
热议问题