iOS核心动画高级技巧(一)

450 阅读1分钟

iOS核心高级技巧 - 文章链接

UIView *layerView = [[UIView alloc] initWithFrame:CGRectMake(100.0f, 100.0f, 200.0f, 200.0f)];
layerView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:layerView];
    
CALayer *blueLayer = [CALayer layer];
blueLayer.frame = CGRectMake(50.0f, 50.0f, 100.0f, 100.0f);
blueLayer.backgroundColor = [UIColor blueColor].CGColor;
[layerView.layer addSublayer:blueLayer];

Simulator Screen Shot - iPhone 8 - 2021-05-29 at 10.22.39.png