RJBlurAlertView 是一个带有模糊背景视图的自定义提醒视图。它可以以下落或弹跳的方式显示。
1.将 RJBlurAlertView.h
、 RJBlurAlertView.m
和 UIImage+ImageEffects.h
、UIImage+ImageEffects.m
复制到您的项目中
RJBlurAlertView 有 RJBlurAlertViewTypeText
和 RJBlurAlertViewTypeCustomView
类型。您可以使用以下方式使用它
RJBlurAlertView *alertView = [[RJBlurAlertView alloc] initWithTitle:@"title" text:@"this is text" cancelButton:YES color:[UIColor blueColor]];
//set animation type
alertView.animationType = RJBlurAlertViewAnimationTypeDrop;
[alertView setCompletionBlock:^(RJBlurAlertView *alert, UIButton *button) {
if (button == alert.okButton) {
NSLog(@"ok button touched!");
}else{
NSLog(@"cancel button touched!");
}
}];
[alertView show];
UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 180, 180)];
contentView.backgroundColor = [UIColor blackColor];
RJBlurAlertView *alertView = [[RJBlurAlertView alloc] initWithTitle:@"title" contentView:contentView cancelButton:YES color:[UIColor blueColor]];
[alertView show];