나는 두 개의 서로 다른 색깔의 문자열을 표시 할 필요가있는 UILabel의이 : 다음은 내 코드입니다 :여러 가지 빛깔의 5
는 미세하지만의에서 iOS 5 및 이전 버전을 작동하는 아이폰 OS 6에서NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithAttributedString: lbl_question.attributedText];
[text addAttribute: NSForegroundColorAttributeName value: [UIColor colorWithRed:52.0f/255.0f green:104.0f/255.0f blue:165.0f/255.0f alpha:1.0f] range: NSMakeRange(0,[result integerValue]+1)];
[text addAttribute: NSForegroundColorAttributeName value: [UIColor colorWithRed:75.0f/255.0f green:75.0f/255.0f blue:75.0f/255.0f alpha:2.0f] range: NSMakeRange([result integerValue]+1,[strq length])];
[lbl_question setAttributedText: text];
두 문자열은 매번 ovelapped있어. 또한 텍스트 및 글꼴에 따라 너비를 가져오고 싶습니다. 텍스트에 따라 높이를 높이십시오.
내가 솔루션 ...이 좀 도와주세요 거기있다 확신합니다 .... NSAttributedString은 UIKit 추가 참조에서
기인 문자열 지원은 당신이 DTCoreText 프레임 워크 같은 것을 함께 가야 할 것이다 이전의 OS가 iOS 6에 추가 된 . –