1

I have a strange issue where I am creating a UITextView in interface builder and constraining it appropriately, yet at runtime it seems to be much wider and runs off the screen.

Screenshots:

Interface builder screenshot: https://i.stack.imgur.com/7uyUp.png

Runtime screenshot: https://i.stack.imgur.com/qscV9.png

As you can see (hopefully), the UITextView has equal amounts of room either side in the interface builder. Yet at runtime, it spills off the right hand edge.

Any ideas? Thanks very much!


SOLUTION

As suggested by 'Mystery' setting the struts and springs fixed it! (I assume this is the struts and springs). See the picture below:

Struts and springs

Thanks very much for your help!

myles
  • 1,681
  • 1
  • 15
  • 27
  • I have notice similar problems when using Autolayout, are you also using it? Also do you have the "size to fit" checkbox enabled? That might cause it too. – Zhang Nov 30 '13 at 03:22
  • Autolayout is turned off. I am not sure where the 'Size to Fit' checkbox is, could you direct me? – myles Nov 30 '13 at 03:54
  • check it , it might help http://stackoverflow.com/questions/728704/resizing-uitextview-- – Vizllx Nov 30 '13 at 04:40
  • My apologies, I must have been dreaming. – Zhang Nov 30 '13 at 08:41

1 Answers1

0

Set struts and springs for the UITextView

Mystery
  • 552
  • 6
  • 14