[英]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.