I'd like to display a temporary message on the iPhone/iPad displaying confirmation of an action, or some quick status about some background activity.
Is there a standard control to do this? I've seen apps do this. A rounded rectangle, dark and partially transparent with text inside. It does not ask for user input but disappears on its own in some short period of time. Android has a similar construct which is standard. Also similar to the windows displayed by Growl.
Suggestions appreciated.
You can turn app notifications on or off, have notifications play a sound, choose how and where you want app notifications to appear when your device is unlocked, and more. Go to Settings > Notifications. To schedule a notifications summary, tap Scheduled Summary, then turn on Scheduled Summary.
To show the contents of notifications on the Lock Screen without unlocking your device, go to Settings > Notifications > Show Previews, and select Always.
Unfortunately, there is no way to view notifications once you've deleted them. If you delete, clear, or open one, it will no longer appear on your iPhone's lock screen, and there's no way to retrieve it.
Go to Settings and tap Notifications. Select an app under Notification Style. Under Alerts, choose the alert style you want. If you've turned on Allow Notifications, you can choose when you want the notifications to be delivered – immediately or in the scheduled notification summary.
There is a user library on cocoacontrols.com that emulates the Android-style Toast pop-ups. Might be what you are looking for.
http://www.cocoacontrols.com/platforms/ios/controls/altoastview
There's also this one that follows the same idea.
http://www.cocoacontrols.com/platforms/ios/controls/itoast
Create a class that inherits from UIAlertView
. In your constructor just call [super init]
and then add any view you want as a subview. You can even design this view in Interface Builder. Something like this:
- (id)initWithMessage:(NSString *)message dismissAfter:(NSTimeInterval)interval { if ((self = [super init])) { CustomView * customView = [[[CustomView alloc] init] autorelease]; // or load from NIB [self addSubview:customView]; [self performSelector:@selector(dismissAfterDelay) withObject:nil afterDelay:interval]; } return self; } - (void)dismissAfterDelay { [self dismissWithClickedButtonIndex:0 animated:YES]; }
To display your custom alert view just init it, and call show
as with a regular UIAlertView
.
CustomAlertView * cav = [[CustomAlertView alloc] initWithMessage:@"Doing Something]; [cav show]; [cav release];
As an nice side-effect, when you present this view the background will darken and you will get the nice wobbly animation for any alert view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With