【问题标题】:UIBezierpath Draw Loading CircleUIBezierpath 绘制加载圆
【发布时间】:2015-12-11 06:49:45
【问题描述】:

我需要使用 UIBezierPath 在 iOS 中绘制如下图所示的加载图形。谁能建议我如何做到这一点?

我需要像“svprogresshud”这样的加载器图形

【问题讨论】:

    标签: ios objective-c core-animation uibezierpath uianimation


    【解决方案1】:

    试试这个你会有所了解的。

    UIBezierPath *bezierPath = [UIBezierPath bezierPath];
    [bezierPath addArcWithCenter:center radius:50 startAngle:0 endAngle:2 * M_PI clockwise:YES];
    CAShapeLayer *progressLayer = [[CAShapeLayer alloc] init];
    
    [progressLayer setPath:bezierPath.CGPath];
    [progressLayer setStrokeColor:[UIColor colorWithWhite:1.0 alpha:0.2].CGColor];
    [progressLayer setFillColor:[UIColor clearColor].CGColor];
    [progressLayer setLineWidth:0.3 * self.bounds.size.width];
    [progressLayer setStrokeEnd:volume/100];
    [_circleView.layer addSublayer:progressLayer];
    

    【讨论】:

    • 根据你的改变UI。
    猜你喜欢
    • 2017-09-12
    • 2013-04-16
    • 2018-04-02
    • 2014-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-02
    相关资源
    最近更新 更多