在UITextView中捕获滚动操作

Jon*_*gel 4 cocoa-touch scrollview uiscrollview uikit ios

我希望能够存储UITextView的滚动位置.我想将它绑定到AppController属性,以便其他标签页可以使用它.

我可以设置并获取ContentOffset值,但我认为需要通知滚动事件以更新属性.我该怎么做呢?

omz*_*omz 7

UITextView是它的子类UIScrollView,因此您可以在视图的委托中实现该UIScrollViewDelegate方法scrollViewDidScroll:.