小编OAZ*_*OAZ的帖子

无法设置CALayer帧

我想CALayer在下面的代码中设置我的框架

CGRect VFrame;
VFrame = CGRectMake(self.viewNo2.frame.origin.x, self.viewNo2.frame.origin.y, self.viewNo2.frame.size.width, self.viewNo2.frame.size.height);

self.customLayer = [CALayer layer];
self.customLayer.frame = VFrame;
self.customLayer.contentsGravity = kCAGravityResizeAspectFill;
[self.view.layer addSublayer:self.customLayer];
Run Code Online (Sandbox Code Playgroud)

由于某种原因,图层在这个框架周围的某处,但不是我想要声明的框架.

有谁知道这是什么问题?

iphone xcode subview calayer ios

5
推荐指数
1
解决办法
1366
查看次数

标签 统计

calayer ×1

ios ×1

iphone ×1

subview ×1

xcode ×1