Sự khác nhau giữa việc thêm chế độ xem con vào chế độ xem bản thân và chế độ xem nội dung là gì?Phân lớp UITableViewCell chính xác?
subview thêm vào tự
- (id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) {
UIImage *img = [UIImage imageNamed:@”lol.jpg”];
UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
[self addSubview:imgView];
[imgView release];
return self;
}
subview thêm vào contentView
- (id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) {
UIImage *img = [UIImage imageNamed:@”lol.jpg”];
UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
[self.contentView addSubview:imgView];
[imgView release];
return self;
}