Guest User

Untitled

a guest
Jul 16th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration {
  2.  
  3. CGRect apprect;
  4. apprect.origin = CGPointMake(0.0f, 0.0f);
  5.  
  6. if ((orientation == UIInterfaceOrientationLandscapeLeft) || (orientation == UIInterfaceOrientationLandscapeRight))
  7. apprect.size = CGSizeMake(480.0f, 300.0f);
  8. else
  9. apprect.size = CGSizeMake(320.0f, 460.0f);
  10.  
  11. // Iterate through the subviews and inset each item
  12. float offset = 32.0f;
  13. for (UIView *subview in [self.view subviews])
  14. {
  15. CGRect frame = CGRectInset(apprect, offset, offset);
  16. [subview setFrame:frame];
  17. offset += 32.0f;
  18. }
  19. }
Add Comment
Please, Sign In to add comment