简体   繁体   中英

UITextView is not showing long text

I have an UITextView inside a UIScrollView. The textView display correctly when text is not too long.

在此输入图像描述

But when text is long long, it is not showing text in textView. However, the textView is still selectable.

在此输入图像描述

Here is my layout.

在此输入图像描述

Thank you so much!

I had the same problem displaying very long text (33745 chars) in a UITextView and after experimenting with different copy lengths the limitation is with the simulator. If the number of chars was over 7435 the simulator did not show the text but I could scroll, copy etc.

But testing on several devices, the 33745 chars text displayed correctly.

Just say

yourTextView.scrollEnabled = YES;

and see the magic

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