TAlertView 0.2.0

TAlertView 0.2.0

测试已测试
语言语言 Obj-CObjective C
LICENSE MIT
发布最后发布2014年12月

Washington Miranda 维护。




  • Washington Miranda

预览

Screenshot of Input Examples

功能

  • 简单易用
  • 代码块语法
  • 物理动画用户交互
  • UIAppearance 支持

用法

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

安装

如何使用

简单

[[[TAlertView alloc] initWithTitle:@"Great!" andMessage:@"This is a basic alert"] show];

或带有按钮

TAlertView *alert = [[TAlertView alloc] initWithTitle:nil
                                              message:@"This alert show two buttons horizontally"
                                              buttons:@[@"No", @"Yes"]
                                          andCallBack:^(TAlertView *alertView, NSInteger buttonIndex) {
                                                          //Your actions
                                                      }];
alert.buttonsAlign = TAlertViewButtonsAlignHorizontal;
[alert showAsMessage];

更改外观

TAlertView *appearance = [TAlertView appearance];
    appearance.alertBackgroundColor     = [[UIColor blackColor] colorWithAlphaComponent:0.8];
    appearance.titleFont                = [UIFont fontWithName:@"Baskerville" size:22];
    appearance.messageColor             = [UIColor whiteColor];
    appearance.messageFont              = [UIFont fontWithName:@"Baskerville-SemiBoldItalic" size:14];
    appearance.buttonsTextColor         = [UIColor whiteColor];
    appearance.buttonsFont              = [UIFont fontWithName:@"Baskerville-Bold" size:16];
    appearance.separatorsLinesColor     = [UIColor grayColor];
    appearance.tapToCloseFont           = [UIFont fontWithName:@"Baskerville" size:10];
    appearance.tapToCloseColor          = [UIColor grayColor];
    appearance.tapToCloseText           = @"Touch to close";
    [appearance setTitleColor:[UIColor orangeColor] forAlertViewStyle:TAlertViewStyleError];
    [appearance setDefaultTitle:@"Error" forAlertViewStyle:TAlertViewStyleError];
    [appearance setTitleColor:[UIColor whiteColor] forAlertViewStyle:TAlertViewStyleNeutral];

作者

Washington Miranda, [email protected]

LICENSE

TAlertView 在 MIT 许可证下可用。更多信息请参阅 LICENSE 文件。