Jic*_*hao 1 cocoa-touch core-animation ios
@implementation AVSuperView
- (AVSuperView*)initWithFrame:(CGRect)frame{
if (self = [super initWithFrame:frame]) {
// self.backgroundColor = [UIColor redColor];
self.layer.backgroundColor = [[UIColor redColor] CGColor];
AVLayout* avLayout = [[AVLayout alloc] init];
Run Code Online (Sandbox Code Playgroud)
在上面的自定义UIView中,例如self.backgroundColor和似乎self.layer.backgroundColor相同。是self.backgroundColor包装纸self.layer.backgroundColor吗?
是
self.backgroundColor包装纸self.layer.backgroundColor吗?
是的,这就是事实。同样是真实的frame,的alpha和opacity,以及其他各种特性(更不用说的是,在该视图的图实际上是在层中的图)。
视图及其底层是非常初始的绑定。从某种意义上说,该视图仅存在于赋予图层接收触摸的能力。
| 归档时间: |
|
| 查看次数: |
238 次 |
| 最近记录: |