Quote:
Originally Posted by mathboy
Guys , any little help ?
|
Well When Xcode generated YOURAPPViewController.m, they also included shouldAutorotateToInterfaceOrientation. By default, views display only in portrait orientation, so you need to implement shouldAutorotateToInterfaceOrientation method if you want to support other orientations.
Locate the shouldAutorotateToInterfaceOrientation method and uncomment it. You can support only some orientations such as portrait or landscape with Home button on the right, but we don’t need to limit ourselves to those scenarios. We want to support all orientations so the view rotates correctly no matter how we’re holding the iPhone. To do this, replace return (interfaceOrientation == UIInterfaceOrientationPortrait); with return YES;.
1
// Override to allow orientations other than
2
// the default portrait orientation.
3
- (BOOL)shouldAutorotateToInterfaceOrientation

UIIn terfaceOrientation)interfaceOrientation {
4
// Return YES for supported orientations
5
return YES;
6
}
Now you can build and run it! Hit Command-Left to see your UI rotate with the iPhone simulator. You can Build and Run the project to make sure everything is compiling and running.