3

I have a UITextview. It has enough text in it that it flows into multiple lines. However when I run the app on a device, the text does not flow onto subsequent lines, it's as if the text is carrying on beyond the bounds of the view.

All the settings for the view are the default, but user interaction is disabled. The view has constraints which bound it to the margins of the viewport. I've coloured the background of the view to check this - the view is not running off the edge of the viewport, and has sufficient height that the 2nd and 3rd lines of text should fit on the view, but below the first line of text the view is empty.

What is going on?

fredley
  • 32,953
  • 42
  • 145
  • 236
  • Ok I just enabled scrolling on the view to see if I could scroll the text and find out where it was going... and this fixed it. The text is now displayed correctly. I'd appreciate an explanation of what's causing this behaviour though. – fredley Apr 20 '15 at 16:40
  • When you say "view", what are you talking about? The text view? What is the view hierarchy. – rdelmar Apr 20 '15 at 16:41
  • @rdelmar The view is the UITextView, yes. It is just that in the base view. – fredley Apr 20 '15 at 19:09
  • I can't duplicate your problem. It works fine with constraints to the sides and top, and either a height constraint or one to the bottom. – rdelmar Apr 20 '15 at 19:56

0 Answers0