Re: Auto-scrolling when firstResponder changes...
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