NZAlertViewLandscape 0.0.4

NZAlertViewLandscape 0.0.4

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最后发布Apr 2015

Javier Morant维护。




  • 作者
  • Javier Morant

NZAlertView License MIT

简单直观的提醒视图。类似于推送通知效果。此类使用UIAlertView默认方法和协议。

NZAlertView


NZAlertView


Build Status Analytics

要求

NZAlertView在iOS 6.0及以上版本上运行,支持ARC项目。它依赖于以下Apple框架,这些框架大多数情况下已经包含在Xcode模板中:

  • Foundation.framework

为了构建NZAlertView,您需要 LLVM 3.0或更高版本。

NZAlertView使用UIImage-Helpers项目来操作图像。

将NZAlertView添加到您的项目

源文件

或者您可以直接将源文件添加到项目中。

  1. 下载最新代码版本或将其作为git子模块添加到git跟踪的项目中。
  2. 在Xcode中打开您的项目,然后将所有文件拖放到NZAlertView文件夹中(使用“Product Navigator view”)。如果您的代码存档提取在项目外部,确保选择复制项目时选取。

用法

信息

  • iPadiPhone上工作
  • 带有或不带状态栏均可工作
  • 仅支持在纵向模式下工作
  • 可以修改提醒持续时间(默认:5秒
  • 可以修改动画持续时间(默认:0.6秒
  • 可以更改文本对齐方式(默认:左对齐
  • 一次只能显示1个提醒
  • 代理与UIAlertView类似

样式

  • NZAlertStyleError
  • NZAlertStyleSuccess
  • NZAlertStyleInfo

显示

#import "NZAlertView.h"
...
{
    // There are several ways to init, just look at the class header
    NZAlertView *alert = [[NZAlertView alloc] initWithStyle:NZAlertStyleSuccess
                                                      title:@"Alert View"
                                                    message:@"This is an alert example."
                                                   delegate:nil];

    [alert setTextAlignment:NSTextAlignmentCenter];

    [alert show];      

    // or

    [alert showWithCompletion:^{
    NSLog(@"Alert with completion handler");
    }];                                            
}

委托

  • 所有委托都是可选的
#import "NZAlertViewDelegate.h"
...

- (void)willPresentNZAlertView:(NZAlertView *)alertView;
- (void)didPresentNZAlertView:(NZAlertView *)alertView;

- (void)NZAlertViewWillDismiss:(NZAlertView *)alertView;
- (void)NZAlertViewDidDismiss:(NZAlertView *)alertView;

设置和获取

@property (nonatomic, assign) id delegate;
@property (nonatomic, assign) NZAlertStyle alertViewStyle;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *message;
@property (nonatomic, readonly, getter = isVisible) BOOL visible;

@property (nonatomic, assign) NSString *fontName;
@property (nonatomic) NSTextAlignment textAlignment;
@property (nonatomic, assign) CGFloat alertDuration;
@property (nonatomic, assign) CGFloat animationDuration;
@property (nonatomic, assign) CGFloat screenBlurLevel;

图像和颜色

  • 如果您想更改,图像位于捆绑包中:NZAlertView-Icons.budle
  • 要自定义颜色,扩展 NZAlertViewColor 类并重写方法: errorColorinfoColorsuccessColor

许可

此代码根据 MIT 许可证的条款和条件分发。

变更日志

每个 NZAlertView 版本的简要总结可以在 wiki 上找到。

待办事项

方向

  • 支持横幅模式
  • 支持 iPhone 6 和 iPhone 6 Plus

设计

  • 使用按钮添加样式
  • 创建 NZAlertStyleCustom 样式