demo.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:ui2 作者: controversial 项目源码 文件源码
def demo_ChainedAnimation():
    v = ui.View(frame=(0, 0, 500, 500), background_color="red")
    b = ui.View(frame=(100, 200, 100, 100), background_color="white")
    v.add_subview(b)

    def animation_a():
        b.x = 300

    def animation_b():
        b.x = 100

    a_anim = ui2.Animation(animation_a, 1, easing=ui2.ANIMATE_EASE_IN)
    b_anim = ui2.Animation(animation_b, 1, easing=ui2.ANIMATE_EASE_OUT)

    v.present("sheet", hide_title_bar=True)

    chain = ui2.ChainedAnimation(a_anim, b_anim, a_anim, b_anim, completion=_f)
    chain.play()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号