demo.py 文件源码

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

项目:ui2 作者: controversial 项目源码 文件源码
def demo_ProgressPathView():
    import math
    import random

    p = ui.Path()
    p.move_to(20, 20)
    p.line_to(480, 20)
    p.line_to(480, 250)
    p.add_arc(250, 250, 230, 0, math.radians(110))
    p.add_curve(50, 450, 20, 250, 480, 250)
    p.close()  # This makes the end look nicer

    ppv = ui2.ProgressPathView(p)

    view = ui.View(background_color="white")
    view.add_subview(ppv)
    view.width = view.height = ppv.width = ppv.height = 500
    view.present("sheet", hide_title_bar=True)

    def advance():
        """Advance by a random amount and repeat."""
        pg = ppv.progress + random.random() / 20
        if pg < 1:
            ppv.progress = pg
            ui.delay(advance, random.random() / 2)
        else:
            ppv.progress = 1

    advance()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号