2
votes

I put NSTextView + NSImageView + NSMatrix + NSTextView in a NSScrollView. And I scroll this scrollview to top using following code -

NSPoint pointToScrollTo = NSMakePoint(0, NSMaxY([[singleScrollView documentView] frame]) - [[singleScrollView contentView] bounds].size.height);
[[singleScrollView contentView] scrollToPoint: pointToScrollTo];
[singleScrollView reflectScrolledClipView: [singleScrollView contentView]];

But the problem is when it finish scrolling to top the view gets messed up.. Here is a screenshot -

enter image description here

I tried to force redraw contents with no luck using this -

[txtQTitle setNeedsDisplay:YES];
[viewOptions setNeedsDisplay:YES];
[singleScrollView setNeedsDisplay:YES];

Do anyone have any idea why this is causing and how should be solved?

Edit 1 - When I scroll the view using mouse scroll some part of the singleScrollView gets ok .. here is a screenshot of this - enter image description here

1

1 Answers

5
votes

Try with [[yourScrollView contentView] setCopiesOnScroll:NO]. I think, it should solve your problem.