###自己写的 AlertSheet,总共有3种样式
这个 alertSheet模仿微信的样式,尺寸,文字大小,布局都是跟微信一样的;可以自定义title/message/button/取消按钮等颜色
哦.但是文字的大小,布局不可以改变
,感觉微信的布局真心不错呢!"
###1.有标题,有取消按钮--可以自定义 title/message 文字颜色
- (void)customAlertSheet{
CBWAlertSheet *sheet = [[CBWAlertSheet alloc]init];
sheet.type = CBWAlertSheetTypeCancelButton;
sheet.title = @"标题😄";
sheet.message = @"这个 alertSheet模仿微信的样式,尺寸,文字大小,布局都是跟微信一样的;可以自定义title/message/button/取消按钮等颜色哦.但是文字的大小,布局不可以改变,感觉微信的布局真心不错呢!";
sheet.titleTextColor = [UIColor redColor];
sheet.messageTextColor = [UIColor greenColor];
sheet.cancleButtonColor = [UIColor redColor];
sheet.cancleButtonTextColor = [UIColor yellowColor];
[sheet addSheetWithTitle:@"好的,去点个赞!" color:nil handler:nil];
[sheet addSheetWithTitle:@"去意已决" color:nil handler:nil];
[sheet show];
}
###2.没有标题,有取消按钮--可以自定取消按钮的文字颜色/背景颜色
- (void)customAlertSheetNoTitleType{
//关闭或者修改手势密码
CBWAlertSheet *sheet = [[CBWAlertSheet alloc]init];
sheet.type = CBWAlertSheetTypeCancelButton;
sheet.titleTextColor = [UIColor redColor];
sheet.messageTextColor = [UIColor greenColor];
sheet.cancleButtonColor = [UIColor redColor];
sheet.cancleButtonTextColor = [UIColor yellowColor];
[sheet addSheetWithTitle:@"胖子,快去减肥啦!" color:[UIColor blackColor] handler:nil];
[sheet addSheetWithTitle:@"黑子,你又变胖啦!" color:[UIColor blackColor] handler:nil];
[sheet show];
}
###3.没有取消按钮,没有标题
- (void)customAlertSheetNoCancelType{
CBWAlertSheet *sheet = [[CBWAlertSheet alloc]init];
sheet.titleTextColor = [UIColor redColor];
sheet.messageTextColor = [UIColor greenColor];
sheet.cancleButtonColor = [UIColor redColor];
sheet.cancleButtonTextColor = [UIColor yellowColor];
[sheet addSheetWithTitle:@"羊小年" color:[UIColor blackColor] handler:nil];
[sheet addSheetWithTitle:@"陈小黑" color:[UIColor blackColor] handler:nil];
[sheet addSheetWithTitle:@"The next..." color:[UIColor blackColor] handler:nil];
[sheet show];
}
使用方法:
- 直接拖'CBWAlertSheet'的. h 和 .m 文件
2.使用
pod 'CBWAlertSheet'
如果喜欢帮我 start 一下哦!