如何禁用 NSScrollView 的垂直滚动?
我在 Google 上找不到快速解决方案。
Thanks
在 NSScrollView 子类中试试这个:
- (void)scrollWheel:(NSEvent *)theEvent
{
[super scrollWheel:theEvent];
if ([theEvent deltaY] != 0.0)
{
[[self nextResponder] scrollWheel:theEvent];
}
}
您也可以通过以下方式记录:
NSLog(@"user scrolled %f horizontally and %f vertically", [theEvent deltaX], [theEvent deltaY]);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)