Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
- {
- if (UIInterfaceOrientationIsLandscape(interfaceOrientation))
- {
- NSLog(@"landscape");
- self.scrollView.contentSize = CGSizeMake(480,713);
- }
- else
- {
- NSLog(@"portrait");
- self.scrollView.contentSize = CGSizeMake( 320, 713);
- }
- }
- // Override to allow orientations other than the default portrait orientation.
- - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
- // Return YES for supported orientations.
- NSLog(@"caleld");
- if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) {
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
- {
- scrollView.frame = CGRectMake(0, 0,1024,600);
- self.scrollView.contentSize = CGSizeMake(1024, 768);
- }
- else {
- scrollView.frame = CGRectMake(0, 0, 480, 300);
- self.scrollView.contentSize = CGSizeMake(480,713);
- NSLog(@"contens size frame width %f ,%f",self.scrollView.contentSize.width,self.scrollView.contentSize.height);
- }
- }
- else {
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
- {
- scrollView.frame = CGRectMake(0, 0, 768, 800);
- self.scrollView.contentSize = CGSizeMake(768, 1024);
- }
- else
- {
- scrollView.frame = CGRectMake(0, 0, 320, 460);
- self.scrollView.contentSize = CGSizeMake( 320, 713);
- NSLog(@"contens size frame width %f ,%f",self.scrollView.contentSize.width,self.scrollView.contentSize.height);
- }
- }
- return YES;
- }
Add Comment
Please, Sign In to add comment