Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何自动触发下拉更新 #2

Open
asfman opened this issue Nov 6, 2012 · 10 comments
Open

如何自动触发下拉更新 #2

asfman opened this issue Nov 6, 2012 · 10 comments

Comments

@asfman
Copy link

asfman commented Nov 6, 2012

如题

@Maxwin-z
Copy link
Owner

手工设置状态就行了吧

@taozywu
Copy link

taozywu commented Nov 30, 2012

hi,我看了下你这个xListView,真心说不错。不过我在用你这个过程发现有个不知道是不是问题:当进来加载的时候都会出现footview,导致数据还未填充时会看到此footview,正常应该是不可以的。“ Maxwin-z”你怎么看?然后我这边XListView.java中119~122行注释掉并在145行增加上述注释代码。activity中调用大概如下:

// 最后一页
if (page == totalPage && page > 0) {
mListView.setPullLoadEnable(false);
} else {
mListView.setPullLoadEnable(true);
}

@taozywu
Copy link

taozywu commented Nov 30, 2012

哦,还需要XListView中295行中加上如下:”mEnablePullLoad“的标记

// mEnablePullLoad 为false 则不需要更新footview的BottomMargin
} else if (getLastVisiblePosition() == mTotalItemCount - 1
                && (mFooterView.getBottomMargin() > 0 || deltaY < 0) && mEnablePullLoad ) {

@taozywu
Copy link

taozywu commented Nov 30, 2012

看见后,希望能和你讨论下。

@JosephPeng
Copy link

这个应该可以在onCreate(){} 方法里直接调用 OnRefresh() 即可。

@saltcoffee
Copy link

我也又这个问题,怎么触发进入界面,自动下拉刷新呢?

@taozywu
Copy link

taozywu commented May 22, 2014

在 14/5/21,我回来啦[email protected] 写道:

我也又这个问题,怎么触发进入界面,自动下拉刷新呢?


Reply to this email directly or view it on GitHub:
#2 (comment)

@taozywu
Copy link

taozywu commented May 22, 2014

我现在好久没研究android了。我可以给你一个我后来改的一个listView的例子。希望能帮到你。

2014-05-22 16:22 GMT+08:00, taozy wu [email protected]:

在 14/5/21,我回来啦[email protected] 写道:

我也又这个问题,怎么触发进入界面,自动下拉刷新呢?


Reply to this email directly or view it on GitHub:
#2 (comment)

@Maxwin-z
Copy link
Owner

不好意思,我好久没有关注android这方面的东西。下拉刷新可以看看比较有名的pull to refresh

发自我的 iPhone

在 2014年5月21日,下午4:11,我回来啦 [email protected] 写道:

我也又这个问题,怎么触发进入界面,自动下拉刷新呢?


Reply to this email directly or view it on GitHub.

@midnightviolin
Copy link

  public void startRefresh(){
    if (mPullRefreshing){
        return;
    }

    if (mEnablePullRefresh) {
        smoothScrollToPosition(0);
        mHeaderView.setVisiableHeight(mHeaderViewHeight + 1);
        mPullRefreshing = true;
        mHeaderView.setState(RefreshListViewHeader.STATE_REFRESHING);
        if (mListViewListener != null) {
            mListViewListener.onRefresh();
        }
    }

    resetHeaderHeight();
}

mostly,call this method at handler post runnable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants