• 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: Auto-scrolling when firstResponder changes...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto-scrolling when firstResponder changes...


  • Subject: Re: Auto-scrolling when firstResponder changes...
  • From: Gregory Weston <email@hidden>
  • Date: Tue, 26 Jun 2007 15:25:52 -0400

Eric MORAND wrote:

I have a scroll view containing a view which a lot of text fields and
I'd like the scroll view to scroll automatically when the user hit
the tab button, to make the newly selected firstResponder visible.

Is there an "official" way to achieve such a feature ? Something
already freely available that I have missed, before I try to
implement it by myself ?

- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id) anObject
{
if([anObject enclosingScrollView])
{
(void)[anObject scrollRectToVisible:[anObject bounds]];
}
return nil;
}


The only caveat is this warning:
"This method may be called multiple times while a control is first responder. Therefore, you must return the same field editor object for the control while the control is being edited."
_______________________________________________


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: Auto-scrolling when firstResponder changes...
      • From: Eric MORAND <email@hidden>
  • Prev by Date: Auto-scrolling when firstResponder changes...
  • Next by Date: Re: Auto-scrolling when firstResponder changes...
  • Previous by thread: Auto-scrolling when firstResponder changes...
  • Next by thread: Re: Auto-scrolling when firstResponder changes...
  • Index(es):
    • Date
    • Thread