MJ刷新控件MJRefreshFooterView上拉之后收不回来的解决办法
修改MJRefreshFooterView.m文件中的这个方法 #pragma mark - 状态相关
#pragma mark 设置状态
- (void)setState:(MJRefreshState)state
{
if (_state == state) return;
MJRefreshState oldState = _state;
[super setState:state]; switch (state){ case MJRefreshStatePulling:{
_statusLabel.text = MJRefreshFooterReleaseToRefresh; [UIView animateWithDuration:MJRefreshAnimationDuration animations:^{
_arrowImage.transform = CGAffineTransformIdentity;
UIEdgeInsets inset = _scrollView.contentInset;
inset.bottom = _scrollViewInitInset.bottom;
_scrollView.contentInset = inset;
}];
break;
} case MJRefreshStateNormal:{
_statusLabel.text = MJRefreshFooterPullToRefresh; // 刚刷新完毕
CGFloat animDuration = MJRefreshAnimationDuration;
CGFloat deltaH = [self contentBreakView];
CGPoint tempOffset; int currentCount = [self totalDataCountInScrollView];
if (MJRefreshStateRefreshing == oldState && deltaH > && currentCount != _lastRefreshCount) { tempOffset = _scrollView.contentOffset;
if (_appDelegate.isA) {//A视图:隐藏FooterView
tempOffset.y -= 60;
}else if(!_appDelegate.isA){//B视图:上拉之后显示后面的新数据
tempOffset.y += 60;
}
animDuration = ;
} [UIView animateWithDuration:animDuration animations:^{
_arrowImage.transform = CGAffineTransformMakeRotation(M_PI);
UIEdgeInsets inset = _scrollView.contentInset;
inset.bottom = _scrollViewInitInset.bottom;
_scrollView.contentInset = inset;
}]; if (animDuration == ) {
_scrollView.contentOffset = tempOffset;
}
break;
} case MJRefreshStateRefreshing:{
// 记录刷新前的数量
_lastRefreshCount = [self totalDataCountInScrollView]; _statusLabel.text = MJRefreshFooterRefreshing;
_arrowImage.transform = CGAffineTransformMakeRotation(M_PI);
[UIView animateWithDuration:MJRefreshAnimationDuration animations:^{
UIEdgeInsets inset = _scrollView.contentInset;
CGFloat bottom = MJRefreshViewHeight + _scrollViewInitInset.bottom;
CGFloat deltaH = [self contentBreakView];
if (deltaH < ) { // 如果内容高度小于view的高度
bottom -= deltaH;
}
inset.bottom = bottom;
_scrollView.contentInset = inset;
}];
break;
} default:
break;
}
}
MJ刷新控件MJRefreshFooterView上拉之后收不回来的解决办法的更多相关文章
- bootstrop 日期控件 datepicker被弹出框dialog覆盖的解决办法
筒子们在使用bootstrap的日期控件(datepicker , 现在官网提供的名称叫 datetimepicker)时可能会遇到如上图的问题这是啥原因造成的呢? 答案很简单时输出的优先级造成的(z ...
- phpcmsV9中表单向导在js调用里日期控件在IE下报Calendar未定义的解决办法
最近在phpcmsV9里用表单向导弄个的提交表单,但用了日期和时间类型时,用 <script language='javascript' src='{APP_PATH}index.php?m ...
- 点击ViewGroup时其子控件也变成pressed状态的原因分析及解决办法
这个问题,当初在分析touch事件处理的时候按理应该分析到的,可是由于我当时觉得这块代码和touch的主题不是那么紧密, 就这么忽略掉了,直到后来在这上面遇到了问题.其实这个现象做Android开发的 ...
- 【C#】在窗体中水平居中的控件,到了XP下不居中的解决办法
我时不时会遭遇这个操蛋问题,今天得闲研究了一下,解决如下: A.将窗体FormBorderStyle属性改为Fixed系,当然这会导致用户不能拖拉窗口大小,所以你可能需要B计划↓ B.确保在[VS]中 ...
- Qt qml listview 列表视图控件(下拉刷新、上拉分页、滚动轴)
Qt qml listview下拉刷新和上拉分页主要根据contentY来判断.但要加上顶部下拉指示器.滚动条,并封装成可简单调用的组件,着实花了我不少精力:) [先看效果] [功能] 下拉刷新 ...
- 上拉加载下拉刷新控件WaterRefreshLoadMoreView
上拉加载下拉刷新控件WaterRefreshLoadMoreView 效果: 源码: // // SRSlimeView // @author SR // Modified by JunHan on ...
- android官方下拉刷新控件SwipeRefreshLayout的使用
可能开发安卓的人大多数都用过很多下拉刷新的开源组件,但是今天用了官方v4支持包的SwipeRefreshLayout觉得效果也蛮不错的,特拿出来分享. 简介:SwipeRefreshLayout组件只 ...
- 下拉刷新控件(1)PullToRefreshList示例
有很多控件都可以下拉刷新如,ListView,ExpandableListView,GridView,ScrollView,ViewPager,WebView等, 其中最常见的是ListView.本文 ...
- Android PullToRefresh下拉刷新控件的简单使用
PullToRefresh这个开源库早就听说了,不过一直没用过.作为一个经典的的开源库,我觉得还是有必要认识一下. 打开github上的网址:https://github.com/chrisbanes ...
随机推荐
- Linux 禁用笔记本触摸板
1. 查看有什么设备 xinput list 输出: ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST p ...
- aspnetpager的2种分页方法
<webdiyer:AspNetPager ID="AspNetPager1" UrlPaging="True" PageSize="20&qu ...
- 集合类 Contains 方法 深入详解 与接口的实例
.Net 相等性:集合类 Contains 方法 深入详解 http://www.cnblogs.com/ldp615/archive/2009/09/05/1560791.html 1.接口的概念及 ...
- VC++中几种字符标志的解释
VC++中几种字符标志的解释 LPSTR = char * LPCSTR = const char * LPWSTR = wchar_t * LPCWSTR = const wchar_t * LPO ...
- GetSafeHwnd()函数解释[转]
当我们想得到一个窗口对象(CWnd的派生对象)指针的句柄(HWND)时,最安全的方法是使用GetSafeHwnd()函数,通过下面的例子来看其理由: CWnd *pwnd = FindWindow(“ ...
- Hadoop伪分布配置与基于Eclipse开发环境搭建
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...
- codeforces 377A. Puzzles 水题
A. Puzzles Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/problem/33 ...
- C#使用System.Data.SQLite操作SQLite
使用System.Data.SQLite 下载地址:http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki 得到Sy ...
- HTML5 修改浏览器url而不刷新页面
嘛,起因是黑子大叔在微博上的一条@信息,找起了这个的实现,看了一圈google的中文信息内似乎还没有怎么提到这个的内容,就发表上来. 详细效果就是类似于用Firefox4+/Chrome 5+/Saf ...
- 用iDSDT制作声显卡DSDT
已有 2299 次阅读2011-10-24 21:00 |个人分类:Mac| DSDT 快速增加积分秘笈! windows下!--------------------------------第一步.下 ...