AlertView 是一个ios弹窗框架,可以很简单的集成到自己的项目内,支持pod.
Masonry
和 HexColors
框架,如果项目没有引入请导入这两个框架#import "RAlertView.h"
你懂的pod 'AlertView'
typedef NS_ENUM(NSInteger,AlertStyle) {
SimpleAlert = 0,
ConfirmAlert,
CancelAndConfirmAlert,
};
RAlertView *alert = [[RAlertView alloc] initWithStyle:CancelAndConfirmAlert];
alert.theme =[UIColor redColor];
objective-c alert.isClickBackgroundCloseWindow = YES;
alert.contentTextLabel.attributedText = [TextHelper attributedStringForString:@"AlertView A pop-up framework, Can be simple and convenient to join your project" lineSpacing:5];
```
objective-c RAlertView *alert = [[RAlertView alloc] initWithStyle:SimpleAlert];
按照样式和宽度初始化 width的值可以设置0-1表示小对于屏幕宽度的百分比,如果大于1的值则按照px像素处理 initWithStyle AlertStyle and widthobjective-c RAlertView *alert = [[RAlertView alloc] initWithStyle:SimpleAlert width:0.8];
RAlertView *alert = [[RAlertView alloc] initWithStyle:SimpleAlert width:0.8];
alert.isClickBackgroundCloseWindow = YES;
alert.contentTextLabel.text =@"SimpleAlert \nAlertView A pop-up framework, Can be simple and convenient to join your project";
## CancelAndConfirmAlert
RAlertView *alert = [[RAlertView alloc] initWithStyle:CancelAndConfirmAlert];
alert.headerTitleLabel.text = @"CancelAndConfirmAlert";
alert.contentTextLabel.attributedText = [TextHelper attributedStringForString:@"AlertView A pop-up framework, Can be simple and convenient to join your project" lineSpacing:5];;
[alert.confirmButton setTitle:@"Ok" forState:UIControlStateNormal];
[alert.cancelButton setTitle:@"Cancel" forState:UIControlStateNormal];
alert.confirm = ^(){
NSLog(@"Click on the Ok");
};
alert.cancel = ^(){
NSLog(@"Click on the Cancel");
};
```
排版规范参考 https://github.com/sparanoid/chinese-copywriting-guidelines