iOS CoreAnimation ShadowPath阴影不显示
在线博彩导航
在线博彩导航
当前位置 : 在线博彩导航 > 博彩导航大全

iOS CoreAnimation ShadowPath阴影不显示

在学习CoreAnimation,有个例子中阴影不显示,去掉ShadowPath设置后能正常显示,加上不显示,麻烦看下代码:

    self.IV1 = {
        UIImageView *var = [UIImageView new];
        [self.view addSubview:var];
        [var mas_makeConstraints:^MASConstraintMaker *make {
            make.size.mas_equalToCGSizeMake200, 200;
            make.centerY.mas_equalTovar.superview.multipliedBy2/3.0;
            make.centerX.mas_equalTovar.superview;
        }];
        var.backgroundColor = [UIColor redColor];
        
        var.layer.shadowOpacity = 1.0f;
        //square shadow
        CGMutablePathRef squarePath = CGPathCreateMutable;
        CGPathAddRectsquarePath, NULL, var.frame;
        var.layer.shadowPath = squarePath;
        CGPathReleasesquarePath;
        
        var;
    };

栏目列表

广告位

在线博彩导航