- (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比较标准的写法
猜你喜欢
转载自lizhuang.iteye.com/blog/2068154
今日推荐
周排行