BSAlertView

BSAlertView

  1. 一个用来显示提示框的视图。
  2. 支持自定义效果。

效果

在这里插入图片描述
gitHub地址:https://github.com/FreeBaiShun/BSAlertView

pod集成

pod ‘BSAlertView’

用法

#import "BSAlertView/BSAlertView.h"
- (void)viewDidLoad {
    [super viewDidLoad];
    
    BSAlertView *alertView = [[BSAlertView alloc] initWithFrame:self.view.bounds];
    alertView.labTitle.text = @"标题";
    alertView.labSubTitle.text = @"子标题";
    [self.view addSubview:alertView];
    
    //__weak typeof(alertView) alertViewWeak = alertView;
    alertView.btnLeftClickBlk = ^{
        NSLog(@"左面按钮被点击");
    };
    
    alertView.btnRightClickBlk = ^{
        //typeof(alertViewWeak) alertView = alertViewWeak;
        //[alertView removeFromSuperview];
        NSLog(@"右面按钮被点击");
    };
    
    alertView.shadowViewClickBlk = ^{
         NSLog(@"阴影视图被点击");
    };
    
    //可选配置
    alertView.labTitle.textColor = [UIColor redColor];
    alertView.labTitle.font = [UIFont systemFontOfSize:13.0];
    alertView.labSubTitle.textColor = [UIColor orangeColor];
    alertView.labSubTitle.font = [UIFont systemFontOfSize:13.0];
    
    alertView.labBtnLeft.text = @"确定";
    alertView.labBtnLeft.textColor = [UIColor blueColor];
    alertView.labBtnLeft.font = [UIFont systemFontOfSize:15.0];
    alertView.labBtnRight.text = @"取消";
    alertView.labBtnRight.textColor = [UIColor grayColor];
    alertView.labBtnRight.font = [UIFont systemFontOfSize:15.0];
    
    alertView.viewMiddle.layer.cornerRadius = 0.0;
    alertView.viewShadow.backgroundColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:0.2];
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值