2
어떤 이유로 UITableViewCell에 여러 글꼴이 혼합되어 표시됩니다. 여기에 내가 무슨 뜻인지 보여주는 스크린 샷입니다 :UITableViewCell은 혼합 글꼴을 표시합니다.
참고 각 행의 마지막 번호가 잘못된 글꼴입니다. 테스트 결과에 따르면 어떤 캐릭터가 엉망이되는 것은 다소 무작위 적이기 때문에이 스크린 샷의 마지막 캐릭터가 당신을 버리게합니다. 이것은 나에게 아무 의미
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
UIImageView *iv;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[[cell textLabel] setFont: [UIFont fontWithName:@"BangBang" size: 36.0]];
[[cell detailTextLabel] setFont: [UIFont fontWithName:@"BangBang" size: 32.0]];
iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed: @"woodTableRow~ipad.png"]];
} else {
[[cell textLabel] setFont: [UIFont fontWithName:@"BangBang" size: 22.0]];
[[cell detailTextLabel] setFont: [UIFont fontWithName:@"BangBang" size: 22.0]];
iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed: @"woodTableRow.png"]];
}
[cell setBackgroundView: iv];
[iv release];
cell.textLabel.textColor = [UIColor blackColor];
[[cell textLabel] setShadowColor: [UIColor whiteColor]];
[[cell textLabel] setShadowOffset: CGSizeMake(0, 1)];
[[cell textLabel] setBackgroundColor: [UIColor clearColor]];
cell.detailTextLabel.textColor = [UIColor blackColor];
[[cell detailTextLabel] setShadowColor: [UIColor whiteColor]];
[[cell detailTextLabel] setShadowOffset: CGSizeMake(0, 1)];
[[cell detailTextLabel] setBackgroundColor: [UIColor clearColor]];
switch (indexPath.row) {
case ScoreRow:
[[cell textLabel] setText: @"Score"];
[[cell detailTextLabel] setText: @"1,234"];
break;
case TimeRow:
[[cell textLabel] setText: @"Time"];
[[cell detailTextLabel] setText: @"0:39"];
break;
default:
[[cell textLabel] setText: @""];
[[cell detailTextLabel] setText: @""];
break;
}
}
:
다음은 글꼴을 설정하기위한 내 코드입니다. 누구든지 도와 줄 수 있습니까?
업데이트 :
나는이 두 가지 유래 질문을 검토 한 점에 유의해야하지만 둘 다 도움 :
UITableViewCell Font Not Changing
What is -[UITableViewDelegate willDisplayCell:forRowAtIndexPath:] for?
항상 같은 문자입니까? 즉 4와 9가 맞습니까? – lnafziger
오, 세상에! 그게 전부 야. 글꼴이 불완전합니다. 그것은 0, 1, 2 및 3에 대한 글리프가 있지만 더 이상 없습니다. Arrrggghhhh! 명백한 지적 주셔서 감사합니다. – Axeva