두 가지 중 하나를 수행해야합니다.
1) 테이블보기 아래에 이미지보기를 추가하십시오. 다음과 같이 할 수 있습니다 :
[tableview.superview insertSubview:imageView belowSubview:tableview];
여기에주의해야 할 점은 때때로 코드에서 뷰 스택을 조작하지 않는 것입니다.
2) UITableView 하위 클래스에서 직접 배경을 그릴 수 있습니다. 이렇게하면 tableview의 bg 색상을 먼저 지워야합니다. 여기 내 클래스는 다음과 같습니다
@interface ATSImageTableView : UITableView {
UIImage *backgroundImage;
}
@property (nonatomic, retain) IBOutlet UIImage *backgroundImage;
@end
과 :이 도움이
@implementation ATSImageTableView
@synthesize backgroundImage;
- (void)drawRect:(CGRect)rect {
[backgroundImage drawAtPoint:CGPointZero];
[super drawRect:rect];
}
- (void)dealloc {
[backgroundImage release];
[super dealloc];
}
@end
희망!