GithubHelp home page GithubHelp logo

hxsnackbar's Introduction

HXSnackBar

一个很方便的提供消息提示和动作反馈的库

用法

HXSnackBar *snackBar = [HXSnackBar snackBarWithBuilder:^(HXSnackBarBuilder *builder) {
        builder.containerViewController = self;
        builder.duration = -1;
        builder.noticeText = @"网络好像有点不稳定";
        builder.actionText = @"重新尝试";
        builder.actionBlock = ^{
            NSLog(@"666666");
        };
    }];
    [snackBar show];

HXSnackBarBuilder支持属性

/** 在哪个ViewController中显示 */
@property (nonatomic, weak) UIViewController *containerViewController;

/** 是否从UINavigationBar下面滑出来 */
@property(nonatomic, assign) BOOL isSlideBelowNavigationBar;

/** 显示时长 < 0 为一直显示*/
@property(nonatomic, assign) NSTimeInterval duration;

@property (nonatomic, copy) UIColor *backgroundColor;

/** 提示文本字符串 */
@property(nonatomic, copy) NSString *noticeText;
/** 提示文本颜色 */
@property(nonatomic, copy) UIColor *noticeTextColor;
/** 提示文本字体 */
@property(nonatomic, copy) UIFont *noticeTextFont;

/** 动作文本字符串 */
@property(nonatomic, copy) NSString *actionText;
/** 动作文本颜色 */
@property(nonatomic, copy) UIColor *actionTextColor;
/** 动作文本字体 */
@property(nonatomic, copy) UIFont *actionTextFont;

/** 点击动作按钮的操作block */
@property(nonatomic, copy) actionBlock actionBlock;

hxsnackbar's People

Contributors

chx632996066 avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.