简体   繁体   中英

UITextView hiding some text

I have a UITextView with the Height of 150. I fill up the content dynamically. So, sometime I need to scroll to see the text. But last 3 lines of the content is hidden, it only shows when I scroll the content up. It will hide once I leave the scroll.

Any help to see all the content on the screen with UITextView?

I would put 2 UITextView inside a UIScrollView. I would then place then accordingly: first the one you want always to be visible and secondly the one you want to stay hidden unless the user scrolls up. To do that, just add then to the UIScrollView and then tweak with the contentSize until you find what you need.

Are you setting the text programmatically after the view is loaded? If so, you may need to resize the content view.

You can also check your nib to make sure the textview isn't hanging off the edge of its parent view ever so slightly.

Finally, you can try resizing the content view to be about 15 pixels higher than it already is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM