0

In my Swift 3 application I have several UITextField set without border that should be capable to accept user email, password, etc...

Text alignment is set to center and (see attached pic right side) its size is the entire visible screen (leading and trailing constrains to the border). enter image description here

The problem is that the visible editable area is not the entire text field but a small portion in its center (see attach on the left).

This makes the UI really awful to look at when typing something as it truncates letters: enter image description here

I've tried using padding or insets in my UITextField but it didn't worked well.

Also I tried to refer to this SO question, but again no joy.

*******************EDIT*****************

These are the constrains to the UITextField: enter image description here

Community
  • 1
  • 1
Alex
  • 271
  • 2
  • 4
  • 18
  • It seems you have set leading and trailing constraints incorrectly. Can you show us how you did that? – Ozgur Vatansever Apr 14 '17 at 22:23
  • Yes, I just posted an update! Thanks. Should I try to clear and re-add the constrains ? – Alex Apr 14 '17 at 22:39
  • Your image is showing "This Size Class" selected... Are you *intentionally* setting different constraints for different size classes? – DonMag Apr 14 '17 at 22:51
  • Mmhhh nope. To be honest I haven't touched 'size classes' at all. I just tried to change to "all" instead of This Size Class, but it doesn't change :-( What's annoying me is that once the editing ends the text field perfectly display the full text without any cut – Alex Apr 14 '17 at 23:00
  • Your constraints make no sense. If you have set both leading and trailing it is silly to set center X as well. – matt Apr 14 '17 at 23:26
  • Thanks for the heads up @matt. This doesn't solve the problem by the way :-) – Alex Apr 15 '17 at 13:01
  • I know that. But until you have minimal consistent nonambiguous constraints you can't even begin to debug this. – matt Apr 15 '17 at 13:08

0 Answers0