In NSScrollView the vertical slider always points to bottom of the view

后端 未结 1 798
执念已碎
执念已碎 2021-01-23 19:28

I am developing Mac app. In this app, I am using a NSScrollView\'s instance as scrollView. And I have set a customView which is an instance of NSView in this ScrollView as:

相关标签:
1条回答
  • 2021-01-23 19:49

    I have solved my problem by setting the scrollToPoint property of ScrollView's ContentView. Here is the code:

    [[scrollView verticalScroller] setFloatValue:0.0];
    [[scrollView contentView] scrollToPoint:NSMakePoint(0.0, y)];
    // here y = (difference b/w scrollView's content size height and scrollView's height)
    
    0 讨论(0)
提交回复
热议问题