mtonio91 / AMSmoothAlert

Cool AlertView
MIT License
1.26k stars 158 forks source link

Landscape #27

Open joaopedrok opened 10 years ago

joaopedrok commented 10 years ago

How can i use this component in landscape mode?

It has always been showed in portrait mode.

joaopedrok commented 10 years ago

I really need to use that in landscape. Your component is good but application will be only in landscape mode. Could you please help me?

mtonio91 commented 10 years ago

The component is currently not available in landscape mode. Didn't have the time to make it landscape ready sorry.

But you can do it by playing with the uiwindow coordinates (the alert view superview) and the rotations.

Antoine

zarcon commented 10 years ago

Hello, adding few lines of code solve the problem:

in -(void) performScreenshotAndBlur add bg.transform = CGAffineTransformMakeRotation(M_PI + M_PI_2); // 270 degress

and in -(void) triggerFadeAnimations add self.transform = CGAffineTransformMakeRotation(M_PI_2); // 90 degress

utsengar commented 10 years ago

@zarcon didn't work for me, which line did you add it in?

zarcon commented 10 years ago

@utkarsh2012 open file AMSmoothAlertView.m

then go to -(void) performScreenshotAndBlur{ ... bg.transform = CGAffineTransformMakeRotation(M_PI + M_PI_2); // 270 degress [self addSubview:bg]; }

then go to

-(void) triggerFadeAnimations{ alertView.alpha = 0; alertView.center = CGPointMake([self screenFrame].size.width/2, ([self screenFrame].size.height/2));

self.transform = CGAffineTransformMakeRotation(M_PI_2); // 90 degress

NSMutableArray* animationBlocks = [NSMutableArray new]; ... }