테이블에 구분선이로드되어있을 때 IB에 UITableView의 줄 구분 기호 스타일과 색을 설정했습니다.사용자 지정 UITableViewCell에 줄 구분 기호가 없습니다.
사용자 정의 수퍼 클래스가 CustomTableView
인 UITableView를 사용하고 있습니다.이 서브 클래스는 UITableView
입니다. 이 표에서 사용자 정의 UITableViewCell
도 사용하고 있습니다.
내가 생각할 수있는 유일한 문제는 내 awakeFromNib
메서드에서 '수퍼'구현을 호출하지 않은 경우입니다.하지만 그렇게해서는 안됩니다.
아이디어가 있으십니까? 다음과 같이 코드
편집
내 테이블 셀입니다 - CustomDefaultCell.h> CustomPlainCell.h>있는 UITableViewCell
CustomDefaultCell.m
- (void)awakeFromNib
{
[super awakeFromNib];
// Called when loaded from a nib.
// Override all default cell behaviour here.
//
}
CustomPlainCell.m
- (void)awakeFromNib
{
[super awakeFromNib];
// Called when loaded from a nib.
// Override all default cell behaviour here.
//
// Normal background view
self.backgroundView = [[UIView alloc] initWithFrame:self.frame];
self.backgroundView.backgroundColor = [UIColor whiteColor];
// Selected background view
self.selectedBackgroundView = [[UIView alloc] init];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
//
// Background gradient
CAGradientLayer *selectedViewGradientLayer = [CAGradientLayer layer];
selectedViewGradientLayer.frame = CGRectMake(1.0f, 0.0f, 320.0f, CGRectGetHeight(self.frame) + 1.0f);
selectedViewGradientLayer.colors = @[(id)[UIColor colorWithHue:0.0f saturation:0.0f brightness:0.57f alpha:1.0f].CGColor, (id)[UIColor grayColor].CGColor];
[self.selectedBackgroundView.layer addSublayer:selectedViewGradientLayer];
}
콘텐츠를 그리려면 Quartz를 사용하고 있습니까? –
나는 해당 .h 및 .m –
아는 .xib 파일을 가지고 있지만 .h와 m은 무엇입니까? (내 안에 "코드가있다"라고 말하지 마십시오!) –