0

I am trying to initiate a scroll view in my UITextView and even though I seem to have selected the appropriate boxes, I can't seem to get the scrolling working. I have gone through multiple questions similar to this but none seem to have the answer.

I included an image of Xcode below:

enter image description here

Question 2: When I scroll down the majority of my text shows but the scrolling stops with two sentences or so left and I have to scroll down and hold it there to read. Any way I can fix this so it scrolls all the way to the bottom of the text?

Anton
  • 559
  • 2
  • 15
Ryan E
  • 45
  • 1
  • 10
  • Can you check the two boxes: Bounce Horizontally and Bounce Vertically and see what's happening? Sometimes your content are actually way bigger than your view, and they are touching a invisible outer box. If you can see they actually move, that means there is nothing wrong with touch or scroll, is just the view layout problem. – Anton Jun 16 '14 at 04:41
  • Thank you @TonyD That seemed to have fixed the problem! Your help is much appreciated! – Ryan E Jun 16 '14 at 04:46
  • @TonyD When I scroll down the majority of my text shows but the scrolling stops with two sentences or so left and I have to scroll down and hold it there to read. Any way I can fix this so it scrolls all the way to the bottom of the text? – Ryan E Jun 16 '14 at 05:09
  • Can I copy and paste my comment as answer and you accept it as the answer? – Anton Jun 16 '14 at 05:43
  • Sure, of course. Do you know how to fix my above question as well? @TonyD – Ryan E Jun 16 '14 at 12:11
  • I just added my answer, check out if it can solve your second question. – Anton Jun 16 '14 at 13:34

3 Answers3

0

The text view will not scroll in storyboard, only the app. And the text view will scroll once the content in the text view exceeds the frame size.

rvijay007
  • 1,357
  • 12
  • 20
  • When I run the application, it also does not play and as you can see above, the text is double what you see there so it should be going over the frame size, no? – Ryan E Jun 16 '14 at 04:42
  • The frame of your textview should be within the bounds of your superview. In your picture, the textview is clearly larger than your view. Shrink the textview so the bottom is aligned with the bottom of the superview. – rvijay007 Jun 16 '14 at 08:21
0

Can you check the two boxes: Bounce Horizontally and Bounce Vertically and see what's happening? Sometimes your content are actually way bigger than your view, and they are touching a invisible outer box. If you can see they actually move, that means there is nothing wrong with touch or scroll, is just the view layout problem.

For the content issue, my guess is that the content size is not right, you can programmatically adjust it with textView.frame property, set it to a proper size, such as the frame of the window or the frame of the content, which are CGRect classes. Comment below to see if this can solve your second problem.

Anton
  • 559
  • 2
  • 15
  • Is there any other way to content size? like from the attributes or size inspector? @TonyD – Ryan E Jun 16 '14 at 17:07
  • This link may help with that: http://stackoverflow.com/questions/19049532/how-do-i-size-a-uitextview-to-its-content-on-ios-7 – Anton Jun 16 '14 at 18:34
0

If you're using iOS 7+, you can just turn on auto layout, pin each of the sides of the text view to the edge of its parent view, and it works fine without needing to do anything in code.

Swindler
  • 802
  • 10
  • 9