• 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: Sliding a view into place?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sliding a view into place?


  • Subject: Re: Sliding a view into place?
  • From: Paul Kim <email@hidden>
  • Date: Mon, 18 Sep 2006 16:08:13 -0400


I'd recommend NSViewAnimation. Put the overlay view in another view and animate the frame of the superview to start from a zero width or height frame (depending on which direction) to full frame. Turn off the autoresize flags on the overlay view (or maybe make the margin closest to the source of the "slide-in" resizable). The overlay view will appear to slide on. You may want to animate the underlying view to get it off screen. In this case, like above, put it in a superview and animate it's frame to go to zero and turn off the autoresize flags on the underlying view so it looks like it is staying in place (it just gets clipped by the superview's shrinking frame).


paul

On Sep 18, 2006, at 3:36 PM, Keith Blount wrote:

Hello,

Could anyone give me any advice on the best way of
getting a view to "slide" into place? I have a view
that has three "modes", one of which can be toggled
into the other two, so when the user toggles to one of
these I want that view to "slide" over the top to
enforce the idea that it is kind of an "on-top" view
that can be toggled back off. I guess this thing will
be a lot easier when CoreAnimation comes along, but I
want this working in Tiger...

The approach I am thinking of at the moment is this:

1) Draw both views into an NSImage.
2) Switch to a custom view that draws the image of the
first view.
3) Slide the image of the second view image over the
top of the first using an NSTimer.
4) Switch to the second view.

Is this the usual way of doing this, or am I missing
an easier approach?

Many thanks in advance,
Keith

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Sliding a view into place? (From: Keith Blount <email@hidden>)

  • Prev by Date: Re: Sliding a view into place?
  • Next by Date: Evaluating an NSString to a symbol at runtime...
  • Previous by thread: Re: Sliding a view into place?
  • Next by thread: Evaluating an NSString to a symbol at runtime...
  • Index(es):
    • Date
    • Thread