【发布时间】:2014-03-18 02:38:00
【问题描述】:
我想为列表视图添加拉动刷新功能,但是在列表视图标题中,有一个视图寻呼机,视图寻呼机水平滚动,我不希望列表视图标题响应拉动刷新事件,因为标题是列表视图的一部分,所以我不能使用函数 theseChildrenArePullable(),有没有提供的解决方案?
【问题讨论】:
标签: android android-actionbar pull-to-refresh
我想为列表视图添加拉动刷新功能,但是在列表视图标题中,有一个视图寻呼机,视图寻呼机水平滚动,我不希望列表视图标题响应拉动刷新事件,因为标题是列表视图的一部分,所以我不能使用函数 theseChildrenArePullable(),有没有提供的解决方案?
【问题讨论】:
标签: android android-actionbar pull-to-refresh
如果您使用的是 Chris Banes 的 PTR:
https://github.com/chrisbanes/ActionBar-PullToRefresh
你可以设置可拉的孩子:
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);
【讨论】:
好的,根据我的要求,我fork PTR项目,并在https://github.com/yingchn/ActionBar-PullToRefresh处添加函数。
我已经创建了一个合并原始项目的拉取请求,请参阅https://github.com/chrisbanes/ActionBar-PullToRefresh/pull/283
希望对你有用
【讨论】: