CGAffineTransformMakeScale on UITextView
-
26-10-2019 - |
Question
I have an instance of UITextView. It is actually a box, and when user taps on it, I want to make it bigger. So I implemented CGAffineTransformMakeScale in tap event.
The problem is, the text inside the UITextView gets fuzzy and blurry. I set contentMode = UIViewContentModeRedraw, but didn't affect it.
Any idea? Many thanks in advance.
Solution
This is always going to happen. If you scale it like that using the transform it will always get blurry because the whole textview is scaled, including all contents.
The only way to prevent this is not using the transform scale but simply make the textview frame bigger!
OTHER TIPS
Can you try to reset the text after making the font bigger on the tap?
say
NSString *placeholderText = textView.text;
textView.font = // bigger font proportional to scaling
textView.text = placeholderText;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow