SVPullToRefresh 这个插件怎么修改 loading indicator 的位置

2015-05-28 09:37:57 +08:00
 tsinghan

https://github.com/samvermette/SVPullToRefresh

默认的loading 位置在top 和 bottom, 但有时候顶部会有nav, 这时候loading就会被挡住,所以我想调整loading的位置,

[tableView addPullToRefreshWithActionHandler:^{
// prepend data to dataSource, insert cells at top of table view
// call [tableView.pullToRefreshView stopAnimating] when done
} position:SVPullToRefreshPositionBottom];

发现这个方法的position可以改变位置,但是枚举只有top 和 bottonm, 没有其他值,
应该怎么该?

4048 次点击
所在节点    iDev
27 条回复
Sunnyyoung
2015-05-28 09:49:47 +08:00
使用MJRefresh
likid
2015-05-28 09:52:46 +08:00
手动改源码
tsinghan
2015-05-28 09:56:03 +08:00
@likid 我试着改源码 增加SVPullToRefreshPosition 这个枚举,但是 提示我file not found, 奇怪
tsinghan
2015-05-28 09:57:12 +08:00
@Sunnyyoung MJRefresh 能改indicator 的位置吗
expkzb
2015-05-28 09:58:53 +08:00
应该是使用方式问题,进一步猜测,可能是lz添加tableView的方式有问题
tsinghan
2015-05-28 10:00:18 +08:00
@Sunnyyoung 奥 我在看它的demo
tsinghan
2015-05-28 10:00:47 +08:00
@expkzb 怎么讲? 我现在就是一个tableview上面有个nav
icodesign
2015-05-28 10:01:32 +08:00
在 viewDidAppear 里面就不会被挡住
zjia8765
2015-05-28 10:19:17 +08:00
controller里设置一下 self.edgesForExtendedLayout = UIRectEdgeNone;
tsinghan
2015-05-28 10:38:44 +08:00
@zjia8765 试了一下 确实往下移了一点, 但还是被遮住了一部分
tsinghan
2015-05-28 10:39:29 +08:00
@icodesign 这是什么思路?
zjia8765
2015-05-28 12:05:35 +08:00
你的nav是原生的还是自定义的?执行过隐藏nav的操作吗
tsinghan
2015-05-28 12:22:57 +08:00
@zjia8765 原生的,没有隐藏过
codeface
2015-05-28 12:32:50 +08:00
为什么不用MJRefresh
tsinghan
2015-05-28 12:41:34 +08:00
@codeface 恩, 正在考虑改成MJRefresh
pepsin
2015-05-28 12:44:30 +08:00
他有 custom view 的,可以改改。
icodesign
2015-05-28 13:09:15 +08:00
@tsinghan 跟它的原理有关,设计到 contentInset, contentOffset 的更新时机,你去查查它的 issue 里面有讨论过
xi_lin
2015-05-28 13:29:04 +08:00
@tsinghan 我也从SVPullToRefresh换到MJRefresh上了。我记得SV之前在6p上位置有问题
tsinghan
2015-05-28 14:07:28 +08:00
@icodesign
@pepsin 恩, 我去看看issue里面的问题
tsinghan
2015-05-28 14:13:13 +08:00
额 果然在issue里面发现了这个问题 https://github.com/samvermette/SVPullToRefresh/issues/235
@icodesign

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/194294

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX