Guest User

Untitled

a guest
Jun 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. - (void)orientationChanged:(NSNotification *)notification {
  2. CGSize maxDescriptionLabelSize;
  3. UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
  4. if (deviceOrientation == UIDeviceOrientationUnknown) {
  5. deviceOrientation = lastKnownOrientation==UIDeviceOrientationUnknown?[self interfaceOrientation]:lastKnownOrientation;
  6. } else {
  7. lastKnownOrientation = deviceOrientation;
  8. }
  9. if (UIDeviceOrientationIsLandscape(deviceOrientation)) {
  10. cardBoxImageView.frame = CGRectMake(10, 0, 466, 320);
  11. cardBoxImageView.image = [UIImage imageNamed:@"box-landscape.png"];
  12. santaImage.frame = CGRectMake(208, 71, 245, 225);
  13. santaDescription.frame = CGRectMake(35, 65, 175, 225);
  14. maxDescriptionLabelSize = santaDescription.frame.size;
  15. titleImage.frame = CGRectMake(30, 32, 184, 33);
  16. bumpButton.frame = CGRectMake(165, 273, 150, 50);
  17. } else if(UIDeviceOrientationIsPortrait(deviceOrientation)) {
  18. cardBoxImageView.frame = CGRectMake(0, 0, 320, 466);
  19. cardBoxImageView.image = [UIImage imageNamed:@"box.png"];
  20. santaImage.frame = CGRectMake(39, 218, 245, 225);
  21. santaDescription.frame = CGRectMake(35, 65, 250, 152);
  22. maxDescriptionLabelSize = CGSizeMake(250, 152);
  23. titleImage.frame = CGRectMake(68, 32, 184, 33);
  24. bumpButton.frame = CGRectMake(85, 420, 150, 50);
  25. }
  26.  
  27. }
Add Comment
Please, Sign In to add comment