iOS开发 仿微博的下拉提示框

TSSCrollStatusBar 是一个仿微博的下拉提示,大概效果如图

iOS开发 仿微博的下拉提示框

0. 实现功能

通过分类加属性,给UIScrollView添加了属性ts_scrollStatusBar,来显示和微博下拉刷新类似的下拉提示效果

  • 可以多行

  • 可以动态切换文案

  • 更多功能有待完善

1. 原理

通过给UIScrollView 写分类,在分类中添加属性,并实现 set 和 get 方法来给UIScrollView 添加了属性 :

1
@property (strong, nonatomic) TSScrollStatusBar * ts_scrollStatusBar;

2. 控件封装

TSScrollStatusBar 带有万能创建方法,展示,隐藏方法,切换文案方法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//万能初始化
- (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. 更多功能正在完善中

比如加点击事件等...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值