我将图像添加到图像视图,然后将图像视图添加到视图。自定义视图忽略了自己的框架并从图像视图中获取高度。我该如何解决这个问题?
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIImage* image = [UIImage imageNamed:@"UILabelMe.png"];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, image.size.width, image.size.height)];
[imageView setImage:image];
UIView* customView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 100)];
[customView addSubview:imageView];
return customView;
}