CCActionSheet有三种形式的list
实现样式是模仿微信自定义actionSheet实现的。相似度还是较高的QAQ。
回调方式使用了两种,这里只举例使用block回调。
初始化
CCActionSheet *sheet = [[CCActionSheet alloc] initWithTitle:@"这是CCActionSheet" clickedAtIndex:^(NSInteger index) { NSLog(@"selected: %ld",(long)index); } cancelButtonTitle:@"取消" otherButtonTitles:@"我是第1个选择",@"我是第2个选择",@"我是第3个选择",@"我是第4个选择",@"我是第5个选择",@"我是第6个选择",@"我是第7个选择",nil];
设置样式
sheet.style = CCActionSheetStyleTextCenter;
设置最多cell数显示
sheet.maxCount = 5;
设置list形式下的icon,现在只能以字符串数组传入😄
sheet.iconImageNameArray = @[@"icon_connected",@"icon_connected",@"icon_connected",@"icon_connected",@"icon_connected",@"icon_connected",@"icon_connected",@"icon_connected",@"icon_connected"];
显示
[sheet show];
您还可以访问我的个人博客了解一些细节:http://www.justonecode.com。