以编程方式滚动不带滚动条的 NSTextView

发布于 2024-11-17 14:06:28 字数 206 浏览 5 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文