문제

I want to add pull to refresh function for a listview, but in the listview header, there is a view pager, the view pager scroll horizontal and I don't want to the listview header responding the pull to refresh event, because the header is part of the listview, so I couldn't use the function theseChildrenArePullable(), any solution provided?

도움이 되었습니까?

해결책 2

okay, according to my requirement, I fork the PTR project and add the function at https://github.com/yingchn/ActionBar-PullToRefresh.

and I have create a pull request to merge the original project refer to https://github.com/chrisbanes/ActionBar-PullToRefresh/pull/283

hope it is useful for you

다른 팁

If you are using PTR from Chris Banes :

https://github.com/chrisbanes/ActionBar-PullToRefresh

You can set pullable childs :

ActionBarPullToRefresh.from(getActivity())
       // Here you can mark what views are pullable
       .theseChildrenArePullable(android.R.id.list, android.R.id.empty)
       .listener(this) //Activity implements on refresh listener
       .setup(mPullToRefreshLayout);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top