Share Pastebin
Guest
Public paste!

absentia

By: a guest | Mar 17th, 2010 | Syntax: C | Size: 1.07 KB | Hits: 43 | Expires: Never
Copy text to clipboard
  1.         if (interfaceOrientation == UIDeviceOrientationPortrait) {
  2.                 NSLog(@"MJPVC portrait");
  3.                 [UIView beginAnimations:@"p" context:nil];
  4.                 [UIView setAnimationDuration:0.4];
  5.                 [UIView setAnimationDelegate:self];
  6.                 CGAffineTransform transform = CGAffineTransformIdentity;
  7. //              transform = CGAffineTransformConcat(transform, CGAffineTransformMakeRotation(M_PI/2));
  8. //              transform = CGAffineTransformConcat(transform, CGAffineTransformMakeTranslation(-170,-100));
  9. //              transform = CGAffineTransformConcat(transform, CGAffineTransformMakeScale(0.75, 0.75));
  10.                
  11.                 self.view.transform = transform;
  12.                
  13.                 [UIView commitAnimations];
  14.                
  15.                 CGRect f;
  16.                 f = self.view.frame;
  17.                 f.size.height = 1024;
  18.                 f.size.width = 768;
  19.                 self.view.center = CGPointMake(1024/42, 768/2);
  20.                 self.view.frame = f;
  21.                 NSLog(@"scrollview frame x=%f, y=%f, w=%f, h=%f", f.origin.x, f.origin.y, f.size.width, f.size.height);
  22.                
  23.                 CGSize s = ((UIScrollView*)self.view).contentSize;
  24. //              s.height = 4000;
  25.                 ((UIScrollView*)self.view).contentSize = s;
  26.  
  27.                 NSLog(@"scrollview content size w=%f, h=%f", s.width, s.height);