아마도 내 문제는 귀하와 다를 수 있습니다. 또한 .xib 파일에서 UILabel의 사용자 지정 글꼴을 사용합니다. 텍스트 유형을 "일반"으로 선택하면 효과적입니다. 그러나 "Attributed"텍스트로 변경하면 사용자 정의 글꼴도 설정되지만 UILabel은 기본 글꼴을 표시합니다. 내 솔루션 코드로 사용자 지정 글꼴이 설정됩니다. 여기 내가 (기인 텍스트)와 사용자 정의 글꼴을 설정하는 코드입니다 :
UIFont *font = [UIFont fontWithName:@"ProximaNova-Light" size:13];
NSDictionary *attrDict = @{
NSFontAttributeName : font,
NSForegroundColorAttributeName : [UIColor colorWithRed:155/255.0 green:155/255.0 blue:155/255.0 alpha:1]
};
NSMutableAttributedString *aAttrString = [[NSMutableAttributedString alloc] initWithString:_aboutTeacher.text attributes: attrDict];
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
[style setLineSpacing:3.0f];
[style setAlignment:NSTextAlignmentCenter];
[aAttrString addAttribute:NSParagraphStyleAttributeName
value:style
range:NSMakeRange(0, [_aboutTeacher.text length])];
_aboutTeacher.attributedText = aAttrString;
감사합니다.하지만이 .xib 파일에 대한 클래스를 만들고 싶지 않았습니다. – Alfi