导入HWPopTool.h .m 文件
点击此处下载《弹窗HWPopTool》文件
@property (strong, nonatomic) UIView *contentView;
@property (strong, nonatomic) UIButton *popBtn;
_contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 300)];
_contentView.backgroundColor = [UIColor clearColor];
_popBtn = [UIButton buttonWithType:UIButtonTypeCustom];
_popBtn.frame = CGRectMake(0, 250, 200, 50);
_popBtn.backgroundColor = [UIColor greenColor];
[_popBtn addTarget:self action:@selector(closeAndBack) forControlEvents:UIControlEventTouchUpInside];
UIImageView *imageV = [[UIImageView alloc]initWithFrame:_contentView.bounds];
imageV.image = [UIImage imageNamed:@"jei"];
[_contentView addSubview:imageV];
// 看看pop效果把下面这一句加上
// [_contentView addSubview:_popBtn];
[HWPopTool sharedInstance].shadeBackgroundType = ShadeBackgroundTypeSolid;
[HWPopTool sharedInstance].closeButtonType = ButtonPositionTypeRight;
[[HWPopTool sharedInstance] showWithPresentView:_contentView animated:YES];
- (void)closeAndBack {
[[HWPopTool sharedInstance] closeWithBlcok:^{
[self.navigationController popViewControllerAnimated:YES];
}];
}