0
@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];
カスタムUIViewでは、たとえば、上記のように、self.backgroundColor
とself.layer.backgroundColor
は同じです。 self.backgroundColor
はself.layer.backgroundColor
のラッパーですか?`self.backgroundcolor`と` self.layer.backgroundcolor`の間に違いはありますか?
私のオンラインブックで議論してみるといいかもしれません。http://www.aptt.com/iOSBook/ch16.html#_view_and_layer – matt