Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 09-11-2010, 01:26 PM   #6 (permalink)
schuler1
Registered Member
 
Join Date: Sep 2010
Posts: 1
schuler1 is on a distinguished road
Default Excellent tip

Quote:
Originally Posted by zulfishah View Post
After spending a whole day on this, I finally figured it out. I needed to send resignFirstResponder to the textfields that were keeping the keyboard out, but it ONLY works if you do it before you call the resignFirstResponder inside shouldAutorotateToInterfaceOrientation, and call [self.tableView reloadData] inside didRotateFromInterfaceOrientation

Don't call either of these in willAnimateRotationToInterfaceOrientation. Don't know why exactly, but that's the way it is. I found this out after much trial-and-error. Hope it helps someone in the future.
This is an excellent tip. It appears that there is a bug in 3.1.x that is causing this problem. iOS 4.0 appears to do the right thing.

If I had something to add is the following. If you resign the first responder and then become the first responder again, there is a visible transition as the keyboard disappears and reappears after the rotation.

To avoid this issue, I created a hidden textField.
Then did the following:

Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
 	[hiddenTextField becomeFirstResponder];
	return YES;
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
	[self.tableView reloadData];
	[textViewBeingEdited becomeFirstResponder];
}
schuler1 is offline   Reply With Quote
 

» Advertisements
» Online Users: 399
15 members and 384 guests
alexdesuja, chemistry, Chickenrig, dansparrow, EvilElf, hrushikeshaddon, iconomania, ipodphone, jimmyon122, larhondaxzcw, linkmx, Mnadeep, PlutoPrime, SamorodovAlex, zhaoningmei
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,585
Threads: 94,083
Posts: 402,775
Top Poster: BrianSlick (7,990)
Welcome to our newest member, alexdesuja
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:25 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.