第三方库征服iOS

ActionSheetPicker

2016-05-18  本文已影响0人  petter102

ActionSheetPicker = UIPickerView + UIActionSheet

项目地址:https://github.com/skywinder/ActionSheetPicker-3.0

ActionSheetPicker是一个选择器样式如下

ActionSheetPiker

现有的四种样式: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

上一篇 下一篇

猜你喜欢

热点阅读