2

I was wondering if it is possible to make an alertview looks like this. screenshot

I was searching on github after a library that overrides alertviews. But didn't find anything. Is is possible to do this or should I find another method ?

Kind regards

Edit

This is how my xib looks like at the moment enter image description here

Steaphann
  • 2,797
  • 6
  • 50
  • 109

1 Answers1

1

best to create your own UIViewController

make the view controller the same size as the page to block other touches and make it transparent so it looks like an alert view.

Make it so that instead of your function calling an alert, it loads your new View controller

This is a good example of an animation for your UIViewController to make it act like a typical IOS AlertView

   -(void)initialDelayEnded {
    self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.001, 0.001);
    self.view.alpha = 1.0;
    [UIView animateWithDuration:kTransitionDuration/1.5 animations:^{
        self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.1, 1.1);
    }completion:^(BOOL complete){
        [UIView animateWithDuration:kTransitionDuration/2 animations:^{
            self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.9, 0.9);
        }completion:^(BOOL complete){
            [UIView animateWithDuration:kTransitionDuration/2 animations:^{
                self.view.transform = CGAffineTransformIdentity;
            }];
        }];
    }];
}
Mick MacCallum
  • 129,200
  • 40
  • 280
  • 281
dizzytri99er
  • 930
  • 9
  • 25
  • not sure what you mean but all you need to do is make whatever function you already have initialise the new UIViewController that you design. then somewhere else, place this method substituting in the name of your Viewcontroller to get the animation – dizzytri99er Nov 09 '12 at 15:22
  • Okay, and what do you mean with "place this method substituting in the name of your viewController" – Steaphann Nov 09 '12 at 15:30
  • well when you have got your functionality to call your new view controller.... place that method in the .m file of the view and call the method. That will give it the bounce normal alert views have – dizzytri99er Nov 09 '12 at 15:32
  • Just to clarify the reason for my sizable edit, as of iOS 4 Apple recommends the usage of block based animations as I've changed your post to demonstrate. – Mick MacCallum Nov 09 '12 at 15:32
  • 1
    Nothing wrong with that! In fact, answering questions is how I learned most of what I know. :) – Mick MacCallum Nov 09 '12 at 15:36
  • Okay I understand I think. The only thing I need to know is how to make the view transparent – Steaphann Nov 09 '12 at 15:42
  • @StefGeelen The code above demonstrates how to set the views alpha property to 1.0, so to make a view transparent all you have to do is set alpha to 0.0. – Mick MacCallum Nov 09 '12 at 15:44
  • @NSPostWhenIdle I'v added a screenshot of my xib. All I need to to is make a subClass of UIViewController and add this method in the .m file and call it in the viewDidLoad? Right? – Steaphann Nov 09 '12 at 15:50