UIRefreshControl是IOS自带的刷新控件,只有下拉加载没有上拉刷新
初始化控件
UIRefreshControl *control=[[UIRefreshControl alloc]init];
[control addTarget:self action:@selector(refreshStateChange:) forControlEvents:UIControlEventValueChanged];
UIRefreshControl的tintColor和attributedTitle属性可以修改文字和菊花的颜色,自定义标题
control.tintColor = [UIColor lightGrayColor];
NSAttributedString *StrMuta = [[NSAttributedString alloc]initWithString:@"下拉加载历史消息"];
control.attributedTitle = StrMuta;
效果图如下