objective c - Scrolling a NSScrollView not working -


I am trying to scroll an NSScrollView below the view using this code:

< Pre> NSPoint newScrollOrigin; If ([[self.chatScreen documentView is duplicated) {newScrollOrigin = NSMakePoint (0.0, NSMaxY ([[self.chatScreen documentView] frame) - NSHite ([[self.chatScreen contentView] border)); } And {newScrollOrigin = NSMakePoint (0.0.0.0); } Self.chatScreen.backgroundColor = [NSColor redColor]; [[Self. Chat screen document view] scrollpoint: nucoologreen];

which came from here:

When I run my program, it partially scrolls down under the scene, where the screen shows above the scene (Default starting position) But when I try to scroll, it jumps to the bottom of the page, where I can scroll normally.

If I scroll around any part of the scene, the next time it updates (which triggers it to jump back down) it seems that nothing happened, until Do not try to scroll, which again causes the jump back to the bottom of the page.

Thanks in advance. / P>

You need to scroll clip view and not document view.
Document view fills the entire scroll view and the clip view is an overlay, which scrolls to decide what parts are visible.

  [[self.chatScreen contentView] scrollToPoint: newScrollOrigin]; Note  scrollToPoint  instead of NSView's layer  scrollpoint  When you see the NSLL to display the scrollers update, always good practice Scroll up. . 

- (zero) mirrorcopyclip view: (NSClipView *) aclipView;

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -