问题
Please try the following in Xcode 9 storyboard:
- drag a new text field somewhere in a ViewController
- set some placeholder text
- set border style to none (left dotted one)
- set a background color
I always get the text off center and clipped like this:
When I run the app it looks fine vertically centered as it should. Also when you increase the height the text eventually disappears altogether.
Adding a left, top and right constraint helps because it makes the text field's height match the height of the text. The problem with this is the smaller tappable area of the text field.
I couldn't find a mention of this storyboard bug anywhere, how come?
来源:https://stackoverflow.com/questions/46826355/text-field-text-in-xcode-9-storyboard-off-center-and-clipping