JMActionSheetDescription 介绍
JMActionSheetDescription 是 ActionSheet 和 UIActivityViewController
的替代品,使用描述器组件。
使用示例:
//init your description JMActionSheetDescription *desc = [[JMActionSheetDescription alloc] init]; //Configure your colors desc.actionSheetTintColor = [UIColor grayColor]; desc.actionSheetCancelButtonFont = [UIFont boldSystemFontOfSize:17.0f]; desc.actionSheetotherButtonFont = [UIFont systemFontOfSize:16.0f]; //Cancel item JMActionSheetItem *cancelItem = [[JMActionSheetItem alloc] init]; cancelItem.title = @"Cancel"; desc.cancelItem = cancelItem; //Can configure a context for your action .. an url ? image ? (work in progress) JMActionContextItem *contextItem = [[JMActionContextItem alloc] init]; contextItem.image = [UIImage imageNamed:@"gif_experiments"]; contextItem.imageHeight = 200.0f; desc.contextItem = contextItem; desc.title = @"Available actions for component"; //item + block JMActionSheetItem *itemShare = [[JMActionSheetItem alloc] init]; itemShare.title = @"last action"; itemShare.action = ^(void){ NSLog(@"last action pressed"); }; //Pickeritem + block JMActionSheetPickerItem *pickerItem = [[JMActionSheetPickerItem alloc] init]; pickerItem.elements = @[@"One", @"Two", @"three", @"Four"]; pickerItem.pickerAction = ^(Nsstring *selectedValue){ NSLog(@"selectedValue %@",selectedValue); }; desc.items = @[itemShare,pickerItem]; [JMActionSheet showActionSheetDescription:desc inViewController:self];
JMActionSheetDescription 官网
https://github.com/leverdeterre/JMActionSheetDescription
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。