SVPullToRefresh 这个插件怎么修改 loading indicator 的位置 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
tsinghan
V2EX    iDev

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

  •  
  •   tsinghan 2015-05-28 09:37:57 +08:00 4828 次点击
    这是一个创建于 3864 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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, 没有其他值,
    应该怎么该?

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

    像 @icodesign 的,之前 iOS 7 到 iOS 8 之修改一次 content inset 更新制,大多 refresh control 都跪了。然大多蠢和工程都不得那有什,即使是 Twitter 也用了我三倍多的解的更新。
    icodesign
        22
    icodesign  
       2015-05-28 15:27:09 +08:00
    @Elethom 这个库的好处就是实现很轻巧
    tsinghan
        23
    tsinghan  
    OP
       2015-05-28 15:35:07 +08:00
    Elethom
        24
    Elethom  
       2015-05-28 15:44:42 +08:00   1
    @icodesign
    候我是不是淡淡的一 _> 的表情加上一句「哦」呢。
    https://github.com/Elethom/PRRefreshControl
    至於 MJRefresh 我的就是一「垃圾」, apps 的 refresh control 一比一用且看真是多了了,基本的交互做好又加了那多有什卵用的功能也是得不行。
    black
        25
    black  
       2015-05-28 17:46:58 +08:00
    @Elethom 哈哈哈哈,赞同得不行!
    SeanChense
        26
    SeanChense  
       2015-05-31 19:19:21 +08:00 via iPhone
    介个,nav 是半透明的 tableview 就是从顶部开始的,菊花就会被挡住。
    nav 不透明 tableview 就是从 nav 底部开始,菊花就不会被挡住。没有半透明需求,直接设成不透明就解决这个问题了 :)
    ibremn
        27
    ibremn  
       2015-06-05 11:12:54 +08:00
    关于MJRefresh那个。。赞同 @Elethom
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     3056 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 27ms UTC 12:02 PVG 20:02 LAX 04:02 JFK 07:02
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86