相关疑难解决方法(0)

动画Core Animation中圆形箭头蒙版的长度

我使用CAShapeLayer和masking创建了一个圆形动画.这是我的代码:

- (void) maskAnimation{


    animationCompletionBlock theBlock;
    imageView.hidden = FALSE;//Show the image view

    CAShapeLayer *maskLayer = [CAShapeLayer layer];

    CGFloat maskHeight = imageView.layer.bounds.size.height;
    CGFloat maskWidth = imageView.layer.bounds.size.width;


    CGPoint centerPoint;
    centerPoint = CGPointMake( maskWidth/2, maskHeight/2);

    //Make the radius of our arc large enough to reach into the corners of the image view.
    CGFloat radius = sqrtf(maskWidth * maskWidth + maskHeight * maskHeight)/2;

    //Don't fill the path, but stroke it in black.
    maskLayer.fillColor = [[UIColor clearColor] CGColor];
    maskLayer.strokeColor = [[UIColor blackColor] CGColor];

    maskLayer.lineWidth = …
Run Code Online (Sandbox Code Playgroud)

core-animation objective-c caanimation ios

4
推荐指数
1
解决办法
3850
查看次数

标签 统计

caanimation ×1

core-animation ×1

ios ×1

objective-c ×1