Cocoa Scroll view keeps bouncing on mavericks in the middle of the file

给你一囗甜甜゛ 提交于 2019-12-10 20:55:33

问题


Does anybody know why when scrolling (via two finger touch) rapidly up and down it "catches" quite often and bounces incorrectly in the middle of a scrollview? This behavior is quite annoying and makes for a bad user experience.

Xcode has scrollviews which bounce both horizontally and vertically and doesn't nearly-as-often get stuck this way.


回答1:


That seems like a bug in NSScrollView.

You can enable predominant axis scrolling, which mostly eliminates the problem:

scrollView.usesPredominantAxisScrolling = YES;

Or, you can disable horizontal bouncing, which is what Finder does:

scrollView.horizontalScrollElasticity = NSScrollElasticityNone;


来源:https://stackoverflow.com/questions/21339616/cocoa-scroll-view-keeps-bouncing-on-mavericks-in-the-middle-of-the-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!