0

Could someone please explain the meaning of the UITextField storyboard error ...

"Fixed leading and trailing constraints with a center constraint may cause clipping"

Is the error concerned with clipping of text or the container itself being clipped? If it's worried about text, of course it could be clipped, because a user might type in lots of text.

I have a UITextField with this error that I just can't shake. Tried removing an align centre constraint and adjusting centre text alignment to left alignment. No luck. My storyboard has lots of other UITextFields with similar constraints, but no errors?

Any advice?

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Shane
  • 397
  • 1
  • 4
  • 15
  • Why would you need leading, trailing and centre? That doesn't make any sense?? – AMAN77 Oct 05 '17 at 07:31
  • @AMAN77 - I had a leading and trailing constraint to fix the horizontal position of the UITextField in the container, and a centre constraint to centrally align a UILabel below it (which I've since changed to leading and trailing). I'm assuming the centre constraint causing the error is the text alignment, which is centred. I tried changing to left oriented text, but that didn't work. – Shane Oct 05 '17 at 09:35
  • could be a bug? found these... https://stackoverflow.com/questions/45122691/xcode-9-fixed-width-constraints-may-cause-clipping-and-other-localization-wa OR https://stackoverflow.com/questions/46226756/fixed-leading-and-trailing-constraints-may-cause-clipping-bug – AMAN77 Oct 05 '17 at 12:01

0 Answers0