KSToastView, 由 Android Toast小部件激发的简单弹出式通知

分享于 

3分钟阅读

GitHub

  繁體 雙語
Simple Popup Notification inspired by Android Toast.
  • 源代码名称:KSToastView
  • 源代码网址:http://www.github.com/c0ming/KSToastView
  • KSToastView源代码文档
  • KSToastView源代码下载
  • Git URL:
    git://www.github.com/c0ming/KSToastView.git
    Git Clone代码到本地:
    git clone http://www.github.com/c0ming/KSToastView
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/c0ming/KSToastView
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    

    ###KSToastView

    简单的弹出通知,由的Toast小部件

    ScreenShot

    ###KSToastView 配置

    
    + (void)ks_setAppearanceBackgroundColor:(UIColor *)backgroundColor;
    
    
    + (void)ks_setAppearanceCornerRadius:(CGFloat)cornerRadius;
    
    
    + (void)ks_setAppearanceMaxWidth:(CGFloat)maxWidth;
    
    
    + (void)ks_setAppearanceMaxLines:(NSInteger)maxLines;
    
    
    + (void)ks_setAppearanceOffsetBottom:(CGFloat)offsetBottom;
    
    
    + (void)ks_setAppearanceTextAligment:(NSTextAlignment)textAlignment;
    
    
    + (void)ks_setAppearanceTextColor:(UIColor *)textColor;
    
    
    + (void)ks_setAppearanceTextFont:(UIFont *)textFont;
    
    
    + (void)ks_setAppearanceTextInsets:(UIEdgeInsets)textInsets;
    
    
    + (void)ks_setToastViewShowDuration:(NSTimeInterval)duration;
    
    
    
    

    ###KSToastView 显示

    
    + (void)ks_showToast:(id)toast;
    
    
    + (void)ks_showToast:(id)toast duration:(NSTimeInterval)duration;
    
    
    + (void)ks_showToast:(id)toast delay:(NSTimeInterval)delay;
    
    
    + (void)ks_showToast:(id)toast completion:(KSToastBlock)completion;
    
    
    + (void)ks_showToast:(id)toast duration:(NSTimeInterval)duration delay:(NSTimeInterval)delay;
    
    
    + (void)ks_showToast:(id)toast duration:(NSTimeInterval)duration completion:(KSToastBlock)completion;
    
    
    + (void)ks_showToast:(id)toast delay:(NSTimeInterval)delay completion:(KSToastBlock)completion;
    
    
    + (void)ks_showToast:(id)toast duration:(NSTimeInterval)duration delay:(NSTimeInterval)delay completion:(KSToastBlock)completion;
    
    
    
    

    ###Usage

    
    ///show NSString
    
    
    [KSToastView ks_showToast:@"Across the Great Wall we can reach every corner in the world."];
    
    
    
    ///show NSObject description with 2 seconds.
    
    
    [KSToastView ks_showToast:self duration:2.0f];
    
    
    
    ///show with a completion block.
    
    
    [KSToastView ks_showToast:@"Start" duration:3.0f completion:^{
    
    
     NSLog(@"%@", @"End!");
    
    
    }];
    
    
    
    

    ###Installation 只是将 kstoastview。h/m 文件添加到你的项目中,

    或者使用 CocoaPods

    
    pod 'KSToastView', '0.5.7'
    
    
    
    

    ###License MIT许可证( MIT )


    notification  POP  wid  Widget  弹出  Toast  
    相关文章