rohaldb rohaldb - 3 years ago 205
Swift Question

UITextField text moving unexpectedly

Below is a demonstration of how the text in my text field is moving when the text field is active. By applying a background to the field, i found that only the text moves, not the whole text field itself. This is not happening to the text field above as well, only the bottom one

enter image description here

Answer Source

after search for this issue i recommend to change your font to another font. but there is some way to prevent this issue :

you can use this :

 - (void)textFieldDidEndEditing:(UITextField *)textField
 [textField layoutIfNeeded]; //Fixes iOS 9 text bounce glitch
  //...other stuff

please check this links :

Text in UITextField moves up after editing (center while editing)

UITextField text jumps iOS 9

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download