更新时间:2023-11-18 08:22:34
我刚试过这个,它运行正常。
I just tested this and it works fine.
在您的代码中,您将文本视图添加到子视图
。相反,您应该将其添加到滚动视图。
In your code, you are adding the text view to the subview
. Instead, you should be adding it to the scroll view.
子视图什么都不做,只提供红色。您可以通过调用
The subview does nothing, just provide the red color. You can send it to the back by calling
[self.scrollView bringSubviewToFront:textView];
PS:别忘了调整 x
labelFrame
到 subview.frame.size.width +10
。 ; - )
PS: Don't forget to adjust the x
of labelFrame
to subview.frame.size.width +10
. ;-)