I want to show a pop up window in my iPhone app whenever I receive a push notification through didRecieveRemoteNotification. Something like the windows shown in the image attached. I tried doing addSubview with my view controller, but it occupies the entire screen. How do I create the pop-ups?
- there is no screen shot attachedOmar Abdelhafith– Omar Abdelhafith2012-06-11 21:35:36 +00:00Commented Jun 11, 2012 at 21:35
- I did attach the image I got from here: [link] (mobile-patterns.com/edu) Please check.ddd– ddd2012-06-11 21:37:18 +00:00Commented Jun 11, 2012 at 21:37
Add a comment |
1 Answer
Instead of adding a subview with dimensions of the screen {320x460}, create a view with smaller dimensions such as {100,100} and add rounded corners to them via the UIView layer properties
#import <QuartzCore/QuartzCore.h> .... view.layer.cornerRadius = 5; view.layer.masksToBounds = YES; UPDATE: To achieve the background dim effect, contradicting to what I first suggested. Add your PopUp view to a view with a frame of the full screen dimensions {320,460}. You then apply a transparency color to it via the UIColor -colorWithWhite:alpha: method. Like below:
view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];