• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSScrollView animation (animate scroll point)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSScrollView animation (animate scroll point)


  • Subject: Re: NSScrollView animation (animate scroll point)
  • From: Daniel Vollmer <email@hidden>
  • Date: Fri, 02 Sep 2011 12:37:51 +0200

'lo,

On 2 Sep 2011, at 06:54, Indragie Karunaratne wrote:

> This has been asked a few times before, but not after Lion was released so I figured I'd ask again. Is there any way to animate the scroll point of an NSScrollView? I figure that animation must be possible somehow, considering that inertial scrolling is basically animating the scroll point. I expected to see new API's in Lion for this, but there seems to be nothing that was added to NSScrollView that would enable me to easily do this. The only way that comes to mind is to use an NSTimer to create an animation of sorts, but I imagine that this wouldn't perform too well and that it wouldn't look very smooth either.

You can simply animate the bounds-rectangle of the scrollview's clipview, e.g.
	[NSAnimationContext beginGrouping];
	NSClipView* clipView = [[_myView enclosingScrollView] contentView];
	NSPoint newOrigin = [clipView bounds].origin;
	newOrigin.x = MY_NEW_POSITION;
	[[clipView animator] setBoundsOrigin:newOrigin];
	[NSAnimationContext endGrouping];

  Daniel._______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSScrollView animation (animate scroll point) (From: Indragie Karunaratne <email@hidden>)

  • Prev by Date: Re: Overwhelming Options
  • Next by Date: Re: determine whether an ancillary program/task can run
  • Previous by thread: NSScrollView animation (animate scroll point)
  • Next by thread: NSOutlineView - Items only displays when user scrolls in outline view
  • Index(es):
    • Date
    • Thread