先放一个效果图:
直接放代码
#import <UIKit/UIKit.h>
typedef void(^leftBlock)(void);
typedef void(^rightBlock)(void);
@interface YAlertViewController : UIViewController
@property (nonatomic) leftBlock lBlock;
@property (nonatomic) rightBlock rBlock;
@end
@implementation YAlertViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self.view setBackgroundColor:[UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.6]];
_alertView = [self alertView];
}
- (UIView *)alertView{
if (!_alertView) {
_alertView = [[UIView alloc] init];
_alertView.frame = CGRectMake(52.5 / WScale, 172 / HScale, 270 / WScale, 203 / HScale);
_alertView.