开发者

How do I get those small views from the bottom to appear in iOS SDK?

开发者 https://www.devze.com 2023-02-23 04:12 出处:网络
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 s

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消