iOS - UITextView pasting weird behavior - ios

I have an expandable UITextView, everything works fine except pasting. If the text pasted is longer than maximum height expected. I dont see some part of the text. Only happens with Pasting, and only when the text is longer than maximum height. Does anyone have any idea what I am doing wrong?

Related

UITextView on Catalyst with Long text, invisible text ranges when scrolling

I have an issue with Catalyst. I'm trying to display a long text in a UITextView, and on iOS everything works well, no issues.
On Mac (with Catalyst) however, when I scroll the textview, some parts disappear. Does anyone have an idea on how to fix this?
I have tried calling setNeedsLayout/Display/layoutIfNeeded on the textview when scrolling but no luck. The only thing that "worked" is to remove the textview from the view hierarchy and readd it to the container view on scroll finished. Still not ideal, as you lose selection when you want to select some text and scroll. (When I save the selection and re-apply it, then the blue highlight is invisible)
Using a UILabel in a scrollview could work, but then you lose all user interactions (no editing/selecting text)
Does anyone have any idea on how to fix this? Or I should just wait for Apple to fix this.
See the video/gif of the original issue:

Text is not appearing when UITextView's content is more?

I don't need to scroll inside a UITextView so disabling a scrolling property of my UITextView.
It means UITextView's height is dynamic base on his content.
When I added more text in UITextView then text is not appearing.
It is working with less content.
As per my observation if height of UITextView exceeds 8100 then it stops rendering but not sure about it.
here is a structure of storyboard.
I understand your problem and please check below sample, i am modify your sample. This is working in my case.
Refer:- Updated Demo

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

UITextView lineBreakMode not working after setting exclusionPaths

I've a UITextView, contain texts(very long) and a few UIImageView. Every imageView can be move/rotate/resize. All text in this UITextView line-break-mode is NSLineBreakByWordWrapping
Before insert images, the text line-break-mode works fine.
After insert image/images, move/rotate/resize the imageView, I'll reload the exclusionPath, but this time, the line-break-mode doesn't work. When image closer to left or right side, it'll separate the text character-by-character, not word-to-word.
I've been try lots of methods, still not fixed. I've checked Apple's demo, they have this issue too.
Anyone can help?

Text is not fully displayed in UITextView

My UITextView is being very weird.
To explain the problem, the UITextView is placed in an UITableViewCell, and at the first display, the second line is missing :
If I continue scrolling down, and go back to see this UITextView, everything is back to normal:
What is very weird, is that if I set my UITextView as none selectable (what I want in fact), the text is well displayed, but the font is lost :
It seems that I have the same problem described here:
UITextView - setting font not working with iOS 6 on XCode 5
and the fix given (setting the UITextView as Selectable) worked fine for the font. But this problem with the cropped text makes this solution inadequate.
The UITextView has a red background color to be sure that the size is ok.
Everything is done in a Storyboard, but I also tried to set the font manually, the problem is still there.
Have you any hint of what could be wrong?
You can use AutoLayout to adjust the UITextView size inside the cell or you can use
[cell.textView sizeToFit];
I recommend using AutoLayout as it shouldn't harm the performance so much.

Resources