- (void)showActionSheetWithButtons:(NSArray *)buttons withTitle:(NSString *)title {
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle: title
delegate: self
cancelButtonTitle: nil
destructiveButtonTitle: nil
otherButtonTitles: nil];
for (NSString *title in buttons) {
[actionSheet addButtonWithTitle: title];
}
[actionSheet addButtonWithTitle: @"Cancel"];
[actionSheet setCancelButtonIndex: [buttons count]];
[actionSheet showInView:[UIApplication sharedApplication].keyWindow];
}
UIActionSheet比较标准的写法
最新推荐文章于 2016-03-07 16:45:58 发布


234

被折叠的 条评论
为什么被折叠?



