UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0 , 110, 110)];
[self.view addSubview:view];
CAShapeLayer *layer = [[CAShapeLayer alloc] init];
layer.frame = CGRectMake(0, 0 , 110, 110);
NSLog(@"%f,%f",layer.frame.size.width,layer.frame.size.height);
layer.backgroundColor = [UIColor clearColor].CGColor;
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:layer.frame cornerRadius:4.0f];
layer.path = path.CGPath;
layer.lineWidth = 1.0f;
layer.lineDashPattern = @[@4, @4];
layer.fillColor = [UIColor clearColor].CGColor;
layer.strokeColor = [UIColor grayColor].CGColor;
[view.layer addSublayer:layer];
网友评论