以编程方式滚动不带滚动条的 NSTextView
我正在尝试使用 scrollToPoint
方法以编程方式滚动文本视图。如果文本视图有滚动条,则效果很好,但如果我使用 setHasVerticalScroller:NO
禁用它,我会得到一些奇怪的结果:如果我尝试在编程滚动后使用两指手势滚动, textview 自动跳回编程滚动之前显示的点。我已经尝试重新绘制文本视图并实现它,但没有任何效果。
I'm trying to scroll a textview programmatically using the scrollToPoint
method. This works fine if the textview has a scrollbar, but if I disable it with setHasVerticalScroller:NO
, I get some strange results: if I try to scroll using the two-finger gesture after the programmatic scroll, the textview automatically jumps back to the point that was shown before the programmatic scroll. I already tried redrawing the textview and actualizing it, but nothing worked.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论