The environment that I'm using is Xcode8 and iOS10 .
What did i do:
In IB , drag an UITextField
into my main view ,add some constraints to place the textfield in the right place , select the textfield's border style to none, at last, type some text to make the UITextField resize in storyboard ,like below:
In order to see what's going on , i also make the textfield to draw its boundary by adding this in viewDidLoad
:
self.textField.layer.borderWidth = 1;
Build and run , it looks good on device:
The Problem
However,if i try to edit the textfield (when the textfield becomes first responder) , the text moves down :
This issue occurs only when setting the Textfield's border style to none and the text contains Chinese characters , does anyone has a clue of what's happening here ?
I fix this issue by setting the borderStyle to anything but UITextBorderStyleNone
in the interface builder , and then in my vc's viewDidLoad
, change it to UITextBorderStyleNone
, i suppose that this is just another one of many bugs that the interface builder has ? :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With