RKNotificationHub是一個(gè)可以讓UIView簡單實(shí)現(xiàn)氣泡的三方庫
687474703a2f2f692e696d6775722e636f6d2f537045324251762e676966.gif
常用屬性
//創(chuàng)建一個(gè)氣泡
- (id)initWithView:(UIView *)view;
- (id)initWithBarButtonItem:(UIBarButtonItem *)barButtonItem;
//%%% adjustment methods
// 氣泡初始條數(shù)
- (void)setView:(UIView *)view andCount:(NSUInteger)startCount;
// 設(shè)置氣泡的尺寸
- (void)setCircleAtFrame:(CGRect)frame;
// 設(shè)置氣泡顏色,和通知個(gè)數(shù)的顏色
- (void)setCircleColor:(UIColor*)circleColor labelColor:(UIColor*)labelColor;
// 移動(dòng)氣泡的指定位置
- (void)moveCircleByX:(CGFloat)x Y:(CGFloat)y;
// 設(shè)置縮放比例,中心點(diǎn)不變
- (void)scaleCircleSizeBy:(CGFloat)scale;
// 設(shè)置氣泡提示文字的字體
@property (nonatomic, strong) UIFont *countLabelFont;
下面是設(shè)置氣泡提示數(shù)目的
//%%% changing the count
// 增加一條
- (void)increment;
// 增加N條
- (void)incrementBy:(NSUInteger)amount;
// 刪除一條
- (void)decrement;
// 增加N條
- (void)decrementBy:(NSUInteger)amount;
// 當(dāng)前條數(shù)
@property (nonatomic, assign) NSUInteger count;
設(shè)置狀態(tài)
//%%% hiding / showing the count
- (void)hideCount;
- (void)showCount;
設(shè)置動(dòng)畫類型
//%%% animations
- (void)pop; // 彈出
- (void)blink; // 眨眼
- (void)bump; // 跳動(dòng)
由于比較簡單,Demo就不寫了,可以指定任何UIView的提示,默認(rèn)顯示右上角