UITextView 上的 CGAffineTransformMakeScale
我有一个 UITextView 的实例。它实际上是一个盒子,当用户点击它时,我想让它变大。所以我在点击事件中实现了CGAffineTransformMakeScale。
问题是,UITextView 内的文本变得模糊。我设置了 contentMode = UIViewContentModeRedraw,但没有影响它。
有什么想法吗?非常感谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这总是会发生的。如果您使用变换来缩放它,它总是会变得模糊,因为整个文本视图都被缩放,包括所有内容。
防止这种情况的唯一方法是不使用变换比例,而只是使文本视图框架更大!
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!
您可以在点击放大字体后尝试重置文本吗?
说
Can you try to reset the text after making the font bigger on the tap?
say