UITextField has trailing whitespace after secureTextEntry toggle

后端 未结 18 1332
逝去的感伤
逝去的感伤 2020-12-29 19:27

I have a button that toggles between Show/Hide mode (i.e. toggles a UITextField between secureTextEntry NO and YES). The purpose of which is to allow the user to see the pa

18条回答
  •  离开以前
    2020-12-29 20:09

    I had a similar issue and realized it was because I was updating the text before setting the secureTextEntry property. It makes sense that the textField would draw out the caret at the location it'd be at if it were using secureTextEntry.

    I did not read the entire problem nor did I visit the solution linked by OP, but in case someone else has the same issue as me:

    Try updating your text after setting the secureTextEntry property.

提交回复
热议问题