
项目需要,类似系统的UIAlertController的弹窗,但是按钮文字大小颜色需要自定义,ios8.0版本的手机不支持使用kvc改变,于是就自己写了一个,可以自定义文字大小,显示动画有渐变和从底部弹出以及默认的没有动画效果
///使用很简单,类似系统的
CZHAlertView *alertView = [CZHAlertView czh_alertViewWithTitle:@"哈哈哈哈哈哈哈哈" message:@"啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦" preferredStyle:CZHAlertViewStyleActionSheet animationStyle:CZHAlertViewAnimationStyleSlideFromBottom];
CZHAlertItem *item = [CZHAlertItem czh_itemWithTitle:@"取消" style:CZHAlertItemStyleCancel handler:^(CZHAlertItem *item) {
NSLog(@"---点击了");
}];
CZHAlertItem *item1 = [CZHAlertItem czh_itemWithTitle:@"取消2" titleFont:CZHGlobelNormalFont(15) titleColor:CZHColor(0x0000ff) style:CZHAlertItemStyleCancel handler:^(CZHAlertItem *item) {
NSLog(@"---点击了");
}];
CZHAlertItem *item2 = [CZHAlertItem czh_itemWithTitle:@"自定义的按钮样式" titleFont:CZHGlobelNormalFont(12) titleColor:CZHColor(0x00ff00) style:CZHAlertItemStyleDefault handler:^(CZHAlertItem *item) {
NSLog(@"---点击了");
}];
[alertView czh_addAlertItem:item];
[alertView czh_addAlertItem:item1];
[alertView czh_addAlertItem:item2];
[alertView czh_showView];

公司的项目,求支持,如果发现什么问题,可以留言反应,感激不尽
为解决iOS8.0版本中UIAlertController按钮文字大小颜色无法自定义的问题,开发了一款新的弹窗组件CZHAlertView,支持自定义文字大小、颜色及多种动画效果。
2838

被折叠的 条评论
为什么被折叠?



