TSSCrollStatusBar 是一個(gè)仿微博的下拉提示,大概效果如圖
0. 實(shí)現(xiàn)功能
通過(guò)分類加屬性,給UIScrollView添加了屬性ts_scrollStatusBar,來(lái)顯示和微博下拉刷新類似的下拉提示效果
可以多行
可以動(dòng)態(tài)切換文案
更多功能有待完善
1. 原理
通過(guò)給UIScrollView 寫(xiě)分類,在分類中添加屬性,并實(shí)現(xiàn) set 和 get 方法來(lái)給UIScrollView 添加了屬性 :
1@property?(strong,?nonatomic)?TSScrollStatusBar?*?ts_scrollStatusBar;
2. 控件封裝
TSScrollStatusBar 帶有萬(wàn)能創(chuàng)建方法,展示,隱藏方法,切換文案方法
//萬(wàn)能初始化
-?(instancetype)initWithFrame:(CGRect)frame
andShowTime:(CGFloat)showTime
andStayTime:(CGFloat)stayTime
andDismissTime:(CGFloat)dismissTime
andBackColor:(UIColor?*)backColor
andTextColor:(UIColor?*)textColor
andAlpha:(CGFloat)alpha
andTextFont:(CGFloat)textFont
andString:(NSString?*)string;
//展示
-?(void)showWithAuthHidden:(BOOL)autoHidden?andAnimation:(BOOL)?animation;
//隱藏
-?(void)dismissWithAnimation:(BOOL)?animation;
//切換文案
-?(BOOL)configWithString:(NSString?*)string;
3. 更多功能正在完善中
比如加點(diǎn)擊事件等...