使用AHKActionSheet

https://github.com/fastred/AHKActionSheet

基本配置代码:

    AHKActionSheet *actionSheet = [[AHKActionSheet alloc] initWithTitle:NSLocalizedString(@"您确定需要编辑?", nil)];
actionSheet.cancelButtonTitle = @"取消"; [actionSheet addButtonWithTitle:NSLocalizedString(@"信息", nil)
image:[UIImage imageNamed:@"Icon1"]
type:AHKActionSheetButtonTypeDefault
handler:^(AHKActionSheet *as) {
NSLog(@"Info tapped");
}]; [actionSheet addButtonWithTitle:NSLocalizedString(@"添加收藏", nil)
image:[UIImage imageNamed:@"Icon2"]
type:AHKActionSheetButtonTypeDefault
handler:^(AHKActionSheet *as) {
NSLog(@"Favorite tapped");
}]; [actionSheet addButtonWithTitle:NSLocalizedString(@"分享", nil)
image:[UIImage imageNamed:@"Icon3"]
type:AHKActionSheetButtonTypeDefault
handler:^(AHKActionSheet *as) {
NSLog(@"Share tapped");
}]; [actionSheet addButtonWithTitle:NSLocalizedString(@"删除", nil)
image:[UIImage imageNamed:@"Icon4"]
type:AHKActionSheetButtonTypeDestructive
handler:^(AHKActionSheet *as) {
NSLog(@"Delete tapped");
}]; [actionSheet show];

高级配置代码:

- (IBAction)advancedExampleTapped:(id)sender
{
AHKActionSheet *actionSheet = [[AHKActionSheet alloc] initWithTitle:nil]; actionSheet.blurTintColor = [UIColor colorWithWhite:0.0f alpha:0.75f];
actionSheet.blurRadius = 8.0f;
actionSheet.buttonHeight = 50.0f;
actionSheet.cancelButtonHeight = 50.0f;
actionSheet.animationDuration = 0.5f;
actionSheet.cancelButtonShadowColor = [UIColor colorWithWhite:0.0f alpha:0.1f];
actionSheet.separatorColor = [UIColor colorWithWhite:1.0f alpha:0.3f];
actionSheet.selectedBackgroundColor = [UIColor colorWithWhite:0.0f alpha:0.5f];
UIFont *defaultFont = [UIFont fontWithName:@"Avenir" size:17.0f];
actionSheet.buttonTextAttributes = @{ NSFontAttributeName : defaultFont,
NSForegroundColorAttributeName : [UIColor whiteColor] };
actionSheet.destructiveButtonTextAttributes = @{ NSFontAttributeName : defaultFont,
NSForegroundColorAttributeName : [UIColor redColor] };
actionSheet.cancelButtonTextAttributes = @{ NSFontAttributeName : defaultFont,
NSForegroundColorAttributeName : [UIColor whiteColor] };
actionSheet.cancelButtonTitle = @"取消"; UIView *headerView = [[self class] fancyHeaderView];
actionSheet.headerView = headerView; [actionSheet addButtonWithTitle:NSLocalizedString(@"信息", nil)
image:[UIImage imageNamed:@"Icon1"]
type:AHKActionSheetButtonTypeDefault
handler:nil]; [actionSheet addButtonWithTitle:NSLocalizedString(@"添加收藏", nil)
image:[UIImage imageNamed:@"Icon2"]
type:AHKActionSheetButtonTypeDefault
handler:nil]; for (int i = ; i < ; i++) {
[actionSheet addButtonWithTitle:[NSString stringWithFormat:@"分享 %d", i]
image:[UIImage imageNamed:@"Icon3"]
type:AHKActionSheetButtonTypeDefault
handler:nil];
} [actionSheet addButtonWithTitle:NSLocalizedString(@"删除", nil)
image:[UIImage imageNamed:@"Icon4"]
type:AHKActionSheetButtonTypeDestructive
handler:nil]; [actionSheet show];
} #pragma mark - Private + (UIView *)fancyHeaderView
{
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(, , , )];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Cover"]];
imageView.frame = CGRectMake(, , , );
[headerView addSubview:imageView];
UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(, , , )];
label1.text = @"你提供的一些有用信息";
label1.textColor = [UIColor whiteColor];
label1.font = [UIFont fontWithName:@"Avenir" size:17.0f];
[headerView addSubview:label1]; return headerView;
}

模糊背景怎么实现的呢?

先截图:

再模糊:

惯用伎俩哦:)

最新文章

  1. (转)dp和dip是同一个单位
  2. HTML5--页面自动居中
  3. 缓存算法之belady现象
  4. hdu 5288 OO’s Sequence 枚举+二分
  5. 实现struts2框架
  6. ecshop订单中配送方式报错
  7. javascript dom编程艺术笔记之图片库的改进
  8. Linux svn直接删除版本库文件
  9. Render和template?
  10. 自定义ScrollViewer的Touch事件--触摸上下移动ScrollViewer滚动到指定位置
  11. Controller中获取输入参数注解使用总结
  12. JAVA 内存的认识【转】
  13. Android的OkHttp开源框架的使用方法
  14. Apache Sling
  15. 解决ssh登陆很慢的问题
  16. SQL Server 对字符进行排序(数字类的字符)
  17. bowtie2 Linux安装
  18. 一起学习Boost标准库--Boost.StringAlgorithms库
  19. DevExpress 使用条形码二维码控件打印
  20. C++ 读写MySQL经典 (转载)

热门文章

  1. NLP 装桶(Bucketing)和填充(padding)
  2. centos7-安装mysql5.6.36
  3. 个人总结(Alpha阶段)
  4. 开例外!微信小程序登录绕过CAS单点登录(SSO)认证检查
  5. 微信小程序动态生成保存二维码
  6. 网页3D效果库Three.js学习[二]-了解照相机
  7. PHP数组基本的操作方法
  8. Microsoft .NET Pet Shop 4: Migrating an ASP.NET 1.1 Application to 2.0
  9. 浅谈equals和==
  10. BootStrap-select 插件的使用