4

I am using the Xcode 9 interface builder to design my UI. To maintain an UI which looks the same on every kind of Screen ranging from iPhone to iPad I use high constraints to the superview a lot (for example a UiTextField has a hight constraint to the superview with a multiplier of 0.04 etc.)

So far this is working very good however I came across one problem I couldnt solve afterall: While the placeholder is centering vertically without a problem the text itself is being placed below the vertical center which results in text being cut off:

Text center vertically

Text top vertically

I am playing around with the designer since an hour now without any success. Does anyone know if this problem can be solved from within the designer? Beside the custom height the TextField doesnt has any modifications.

Krunal
  • 77,632
  • 48
  • 245
  • 261
MaxWell
  • 43
  • 1
  • 5

1 Answers1

4

Seems to be a bug with the storyboard. It looks ok on emulator and device. Looks like it happens when you have rounded corners and font size < 21 or using a fixed height of the text field.

Workaround: Use intrinsic height with any border style except rounded. If using rounded corners then font size must be 21 or higher (regular system font). But this bug does not affect the running app, so you don't have to bother.

Paintoshi
  • 816
  • 10
  • 12