XAlert 0.1.2

XAlert 0.1.2

StrongX 维护。



XAlert 0.1.2

  • 作者
  • StrongX

XAlert

CI Status Version License Platform

示例

要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 pod install

image

- (IBAction)actionsheet1:(id)sender {
XActionSheet *sheet = [[XActionSheet alloc]initWithTitleAndDesc:@"这是一个上啦菜单" Desc:@"你可以在这里填写一些详细内容"];
[sheet addCancelButtonWithTitle:@"取消"];
[sheet addButtonwithTitle:@"按钮一"];
[sheet addButtonwithTitle:@"按钮二"];
[sheet addButtonwithTitle:@"按钮三"];
sheet.delegate = self;
[sheet show];
}
- (IBAction)actionsheet2:(id)sender {
XActionSheet *sheet = [[XActionSheet alloc]initWithTitleAndDesc:@"这是一个上啦菜单" Desc:@"你可以在这里填写一些详细内容"];
[sheet addCancelButtonWithTitle:@"取消"];
[sheet addButtonwithTitle:@"按钮一"];
[sheet addButtonwithTitle:@"按钮二"];
[sheet addButtonwithTitle:@"按钮三"];
sheet.delegate = self;
[sheet showInAnimate];
}
- (IBAction)AlertView1:(id)sender {
XAlertView *alert = [[XAlertView alloc]initWithTitleAndDesc:@"这是一个警告框" Desc:@"这里可以填一些详细内容"];
alert.btnTitleArray = @[@"按钮一",@"按钮二",@"按钮三"];
alert.delegate = self;
[alert showAnimation1];
}
- (IBAction)AlertView2:(id)sender {
XAlertView *alert = [[XAlertView alloc]init];
alert.containViewHeight = 100;
CGFloat width = alert.containView.frame.size.width;
UIImageView *avatar = [[UIImageView alloc]initWithFrame:CGRectMake((width - 60)/2, 10, 60, 60)];
avatar.layer.cornerRadius = 30;
avatar.layer.masksToBounds = true;
avatar.image = [UIImage imageNamed:@"cute_girl"];
[alert.containView addSubview:avatar];

UILabel *name = [[UILabel alloc]initWithFrame:CGRectMake(0, 10 + 60 + 10,width, 20)];
name.text = @"StrongX";
name.textColor = [UIColor darkGrayColor];
name.textAlignment = NSTextAlignmentCenter;
[alert.containView addSubview:name];

alert.btnTitleArray = @[@"确定",@"关闭"];
alert.delegate = self;
[alert showAnimation2];

}

安装

XAlert 通过 CocoaPods 提供。欲安装它,只需将以下行添加到您的 Podfile 中

pod 'XAlert'

作者

StrongX, [email protected]

许可协议

XAlert 在 MIT 许可协议下可用。有关更多信息,请参阅 LICENSE 文件。