• 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: The simplest way to fade out a view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The simplest way to fade out a view


  • Subject: Re: The simplest way to fade out a view
  • From: Andy Lee <email@hidden>
  • Date: Thu, 19 May 2011 09:49:46 -0400

On May 19, 2011, at 8:26 AM, Nick wrote:
> hello!
> Could you please advice me what would be the best way to "fade out"
> and "fade in" a view? I tried using [[myView automator]

Do you mean [myView animator]?

> setAlphaValue:0.0] but after fading out it does not disappear. I need
> it to "hide" after it fades out, i.e. a user can't click on its
> buttons.
>
> [[myView automator] setVisible:NO] does not animate

There is no setVisible: on NSView. There is setHidden:, but from a quick experiment it does not seem to animate, which is unfortunate.

Offhand I would add a method to that disables/enables all the controls in the view.

// To fade out:
[self _setControlsWithinMyViewEnabled:NO];
[[myView animator] setAlphaValue:0];

// To fade in:
[self _setControlsWithinMyViewEnabled:YES];
[[myView animator] setAlphaValue:1];

Maybe there's a better way.

--Andy

_______________________________________________

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

  • Follow-Ups:
    • Re: The simplest way to fade out a view
      • From: Nick <email@hidden>
References: 
 >The simplest way to fade out a view (From: Nick <email@hidden>)

  • Prev by Date: Re: set keyEquivalent for an NSMenuItem
  • Next by Date: Re: set keyEquivalent for an NSMenuItem
  • Previous by thread: The simplest way to fade out a view
  • Next by thread: Re: The simplest way to fade out a view
  • Index(es):
    • Date
    • Thread