Matt
Matt

Reputation: 2863

iphone Mail App Popup style alertview

Im having a blonde moment i think. What is the control the the iPhone Mail app uses when you click Edit -> select an email -> than click delete. A popup comes up saying "Delete Message" or "Cancel".

Im just wondering what is the control that holds the "Delete Message" and "Cancel" buttons? Any ideas?

Thanks in advance

Upvotes: 0

Views: 240

Answers (3)

TK189
TK189

Reputation: 1500

You can implement custom popup like this:

@implementation UIView(Animation)

    -(void)animationElasticPopup {    
    self.transform = CGAffineTransformMakeScale(0.001f, 0.001f);

    [UIView animateWithDuration:0.4 animations:^{
        [UIView setAnimationDelay:0];
        self.transform = CGAffineTransformMakeScale(1.1f, 1.1f);//1.1
        self.alpha = 1.f;
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.1 animations:^{            
            self.transform = CGAffineTransformMakeScale(0.9f, 0.9f);//0.9
        } completion:^(BOOL finished) {            
            [UIView animateWithDuration:0.1 animations:^{                
                self.transform = CGAffineTransformMakeScale(1.f, 1.f);//1.0
            } completion:^(BOOL finished) {
            }];            
        }];
    }];}





@end

Upvotes: 2

Chris Wagner
Chris Wagner

Reputation: 20993

UIActionSheet is the class you are looking for, it is very simple to display one and works a lot like UIAlertView.

UIActionSheet *confirmationSheet = [[UIActionSheet alloc] initWithTitle:@"Are you sure you want to cancel?" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Delete" otherButtonTitles:@"Save Draft", nil]
[confirmationSheet showFromToolbar:self.myToolbar];

Upvotes: 0

KDaker
KDaker

Reputation: 5909

UIActionSheet or UIAlertView .. I'm not sure what you are talking about but it has to be one of the two.

Upvotes: 1

Related Questions