如何从底部获取这些小视图以显示在iOS SDK中?

Whi*_*ger 5 iphone objective-c uiviewcontroller uiview ios

我在谈论当你需要确认一些动作时带有按钮的小窗户.例如,如果要从相册中删除照片并按垃圾桶图标,则会从底部跳转一个小视图,询问您是要删除照片还是取消

如何显示这些视图?

Ter*_*cox 9

使用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];
Run Code Online (Sandbox Code Playgroud)