RKDropdownAlert 0.3.0

RKDropdownAlert 0.3.0

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布最后发布2015年4月

Richard KimRichard Kim维护。




这是一个非常简单(且可定制)的警告替换方案,基于Facebook的Slingshot应用,并受到SVProgressHUD的启发(是的,使用起来就像SV一样简单)

更新、问题和请求

twitter <--- 我不太发推文,所以不会向您垃圾邮件

比较UIAlertView、SVProgressHUD和RKdropdownAlert的文章

https://medium.com/@cwRichardKim/devux-uialertview-alternatives-3a78ab64cbf8

Pod

等等!如果您想自定义或使用快速简便的[RKDropdownAlert show],请不要使用Pods

pod 'RKDropdownAlert'

演示

[RKDropdownAlert title:@"Hello World" message:@"Tons better than UIAlertView!"];

alt tag

实际操作

first

second

简单的默认调用

[RKDropdownAlert show];

设置默认文本、颜色、大小、字体等,以便在调用“show”时拉出一个简单默认调用

easy

设置

首先,下载文件,或创建仓库的分支。将以下内容复制到您的父控制器中

#import "RKDropdownAlert.h"

您可能想要自定义默认调用 ([RKDropdownAlert show]),以及其他如颜色、用户点击视图时调用的方法等功能。查找

//%%% CUSTOMIZE

RKDropdownAlert.m 中的标签以查找您应自定义的方法。

调用警报

使用以下变体:标题、消息、backgroundColor、textColor和time

+(void)show;
+(void)title:(NSString*)title;
+(void)title:(NSString*)title time:(NSInteger)seconds;
+(void)title:(NSString*)title backgroundColor:(UIColor*)backgroundColor textColor:(UIColor*)textColor;
+(void)title:(NSString*)title backgroundColor:(UIColor*)backgroundColor textColor:(UIColor*)textColor time:(NSInteger)seconds;

+(void)title:(NSString*)title message:(NSString*)message;
+(void)title:(NSString*)title message:(NSString*)message time:(NSInteger)seconds;
+(void)title:(NSString*)title message:(NSString*)message backgroundColor:(UIColor*)backgroundColor textColor:(UIColor*)textColor;
+(void)title:(NSString*)title message:(NSString*)message backgroundColor:(UIColor*)backgroundColor textColor:(UIColor*)textColor time:(NSInteger)seconds;

例如

[RKDropdownAlert show];

[RKDropdownAlert title:@"this is a title" message:@"this is a one line message"];

[RKDropdownAlert title:@"Hello World" message:@"tons better than UIAlertView" backgroundColor:[UIColor grayColor] textColor:[UIColor whiteColor] time:10];

触摸内部方法

编写用户触摸视图时的自定义方法(默认是隐藏视图)

@interface WhateverClassYouLike : NSObject <RKDropdownAlertDelegate>
@end

@implementation WhateverClassYouLike

-(BOOL)dropdownAlertWasTapped:(RKDropdownAlert*)alert {
    // Handle the tap, then return whether or not the alert should hide.
    return true;
}

@end

alt tag

未来改进/参与区域

  • 改进架构以在保持单行部署的同时允许对属性进行自定义,而无需更改物理代码
  • 能够在不更改物理代码的情况下更改文本布局
  • 单例模式
  • 对响应式设计的更严格案例测试(确保不同文本长度仍然看起来不错)