Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)orientationChanged:(NSNotification *)notification {
- CGSize maxDescriptionLabelSize;
- UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
- if (deviceOrientation == UIDeviceOrientationUnknown) {
- deviceOrientation = lastKnownOrientation==UIDeviceOrientationUnknown?[self interfaceOrientation]:lastKnownOrientation;
- } else {
- lastKnownOrientation = deviceOrientation;
- }
- if (UIDeviceOrientationIsLandscape(deviceOrientation)) {
- cardBoxImageView.frame = CGRectMake(10, 0, 466, 320);
- cardBoxImageView.image = [UIImage imageNamed:@"box-landscape.png"];
- santaImage.frame = CGRectMake(208, 71, 245, 225);
- santaDescription.frame = CGRectMake(35, 65, 175, 225);
- maxDescriptionLabelSize = santaDescription.frame.size;
- titleImage.frame = CGRectMake(30, 32, 184, 33);
- bumpButton.frame = CGRectMake(165, 273, 150, 50);
- } else if(UIDeviceOrientationIsPortrait(deviceOrientation)) {
- cardBoxImageView.frame = CGRectMake(0, 0, 320, 466);
- cardBoxImageView.image = [UIImage imageNamed:@"box.png"];
- santaImage.frame = CGRectMake(39, 218, 245, 225);
- santaDescription.frame = CGRectMake(35, 65, 250, 152);
- maxDescriptionLabelSize = CGSizeMake(250, 152);
- titleImage.frame = CGRectMake(68, 32, 184, 33);
- bumpButton.frame = CGRectMake(85, 420, 150, 50);
- }
- }
Add Comment
Please, Sign In to add comment