Skip to content

在执行刷新动作的时候,切换tab再切回来,刷新头回不去 #892

Closed
@XHJiang

Description

@XHJiang
No description provided.

Activity

sun8801

sun8801 commented on Apr 28, 2017

@sun8801

把mjrefreshheader.m中

  • (void)scrollViewContentOffsetDidChange:(NSDictionary *)change方法中的
    if(self.window == nil) return;注释掉应该没问题了
XHJiang

XHJiang commented on May 2, 2017

@XHJiang
Author

谢谢

ShenYj

ShenYj commented on May 22, 2017

@ShenYj

试一下

suxiaoyao

suxiaoyao commented on Jun 27, 2017

@suxiaoyao

遇到同样的问题,总不能每次重新pod都去改代码吧?希望得到回复,应该怎么解决?

hangshaoSH

hangshaoSH commented on Aug 15, 2017

@hangshaoSH

一个界面上面有多个选择按钮 选择了都是自动下拉刷新 如果网速太慢 一直选择 下拉箭头和字就会一直往下走 如果清空数组 还会出现闪退

sjjvenu

sjjvenu commented on Dec 29, 2017

@sjjvenu
if (self.tableView.mj_header.scrollViewOriginalInset.top > 0 && self.tableView.mj_header.state == MJRefreshState.idle) {
            let oldContentInset = self.tableView.contentInset;
            self.tableView.contentInset = UIEdgeInsets.init(top: 0, left: oldContentInset.left, bottom: oldContentInset.bottom, right: oldContentInset.right);
        }

我是这样解决的,在viewwillappear里面加这段代码,需要判断下当前状态,直接设置成为会把上拉刷新给移到屏幕外了

leirenbaobao

leirenbaobao commented on Jul 3, 2018

@leirenbaobao

why remove 'if(self.window == nil)' can fix this problem?

Yulei-Duan

Yulei-Duan commented on Jul 11, 2018

@Yulei-Duan

why remove 'if(self.window == nil)' can fix this problem? 同问

AAChartModel

AAChartModel commented on Aug 2, 2018

@AAChartModel

虽然临时解决了问题,但总归不是完美的方案啊,话说李明杰老师为毛不在 pod 的文件中改一下呢?

sun8801

sun8801 commented on Aug 6, 2018

@sun8801

因为当当前VC不可见时,view.widonw 会为nil,所以代码就不会继续执行复原操作。

1 remaining item

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @wolfcon@Yulei-Duan@leirenbaobao@sjjvenu@sun8801

        Issue actions

          在执行刷新动作的时候,切换tab再切回来,刷新头回不去 · Issue #892 · CoderMJLee/MJRefresh