I have an NSScrollView containing an NSImageView, which resizes based on various factors. When it resizes I have generally changed the image, so I scroll the NSScrollView to the top. This works fine. However, when I start to scroll the NSScrollView again, it moves a few pixels and then (most of the time) jumps to the bottom of the scroll. After it jumps once, it works as normal until I move the scroller to the top again. This is driving me insane. All I'm really doing is this:
[_imageView setImage: anNSImage];
NSRect frame;
NSSize imageSize = [anNSImage] size];
frame.size = imageSize;
frame.origin = NSZeroPoint;
[_imageView setFrame: frame];
[[_mainScrollview contentView] scrollToPoint: NSMakePoint(0, [_imageView frame].size.height - [_mainScrollview frame].size.height)];
My hacky solution. Turn on Show Vertical Scroller (like Chetan said, this is what triggers the bug). Send table view to back. Expand left edge of table view until the scroller is covered by whatever's to the right edge of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With