简体   繁体   English

如何在UIScrollView内放大UITextView?

[英]How to zoom on an UITextView inside a UIScrollView?

I have a UIScrollView which contains instances of an UIView subclass. 我有一个UIScrollView ,其中包含UIView子类的实例。

This UIView has a CAShapeLayer as a sublayer of its layer, and a UITextView as a subview. UIView具有CAShapeLayer作为其层的子层,以及具有UITextView作为子视图。

With zooming enabled on the UIScrollView , the CAShapeLayer remains sharp when I zoom, but the UITextView doesn't. UIScrollView上启用缩放后, CAShapeLayer在缩放时仍保持清晰,但UITextView却没有。

Is there a way to have the UITextView redraw at the correct resolution? 有没有一种方法可以使UITextView以正确的分辨率重绘?

you can use [yourTextView contentScaleFactor] or [yourTextView.layer contentsScale] . 您可以使用[yourTextView contentScaleFactor][yourTextView.layer contentsScale] Set it to the current scalefactor. 将其设置为当前比例因子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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