I'n talking about the small windows with buttons that come from the bottom when you need to confirm some action. For example, if you want to delete a photo from an album and press the trash icon, a small view jumps from the bottom and asks if you want to delete the photo or cancel
开发者_运维知识库How do I get those views to appear?
Use a UIActionSheet.
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Some Action"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:@"OK"
otherButtonTitles: nil];
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[actionSheet showInView:self.view];
[actionSheet release];
You'll want to look at the UIActionSheet object: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIActionSheet_Class/Reference/Reference.html
An example here: http://ykyuen.wordpress.com/2010/04/14/iphone-uiactionsheet-example/
精彩评论