ActionSheetPicker = UIPickerView + UIActionSheet
项目地址:https://github.com/skywinder/ActionSheetPicker-3.0
ActionSheetPicker是一个选择器样式如下

现有的四种样式:ActionSheetStringPicker,ActionSheetDistancePicker,ActionSheetDatePicker, andActionSheetCustomPicker
// Inside a IBAction method:// Create an array of strings you want to show in the picker:NSArray*colors = [NSArrayarrayWithObjects:@"Red",@"Green",@"Blue",@"Orange",nil];[ActionSheetStringPickershowPickerWithTitle:@"Select a Color"rows:colorsinitialSelection:0doneBlock:^(ActionSheetStringPicker *picker,NSIntegerselectedIndex,idselectedValue) {NSLog(@"Picker:%@, Index:%@, value:%@", picker, selectedIndex, selectedValue); }cancelBlock:^(ActionSheetStringPicker *picker) {NSLog(@"Block Picker Canceled"); }origin:sender];// You can also use self.view if you don't have a sender




网友评论