text field text in Xcode 9 storyboard off center (and clipping)

孤人 提交于 2019-12-07 06:47:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!