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
Pasco
V2EX  ›  iDev

facebook 的 pop 中的 kPOPLayerPositionX

  •  
  •   Pasco · 2016-02-14 11:47:11 +08:00 · 2352 次点击
    这是一个创建于 2994 天前的主题,其中的信息可能已经有所发展或是发生改变。

    myLabel 使用动画

    POPSpringAnimation *anim1 = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX];
    anim1.springBounciness = 20;
    anim1.toValue = @100;
    anim1.velocity = @400;
    [self.myLabel.layer pop_addAnimation:anim1 forKey:@"positionAnimation"];

    动画完成后,我点击了一个 UItextfield ,然后 myLabel 的位置又回到原来的位置了。
    什么情况啊这是 0.0.
    咋解决呢。
    其他的什么旋转啊,拉伸啊的动画都正常

    2 条回复    2016-02-19 23:49:41 +08:00
    doluvor
        1
    doluvor  
       2016-02-16 18:29:24 +08:00   ❤️ 1
    点击 UITextField 会触发 Autolayout 的更新,看看是否在 myLabel 上添加了位置的约束。
    如果有约束需要使用 pop 的 kPOPLayoutConstraintConstant 的 animation ,然后添加到约束上。
    Pasco
        2
    Pasco  
    OP
       2016-02-19 23:49:41 +08:00
    @doluvor 太感谢了!解决了我好几天的困惑
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2835 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 14:53 · PVG 22:53 · LAX 07:53 · JFK 10:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.