UILabel
에 다른 텍스트의 다른 글꼴을 표시해야합니다. 다음과 같이인덱스없이 텍스트 속성을 사용하는 방법
내가, 우리가 속성의 텍스트를 사용하여 단일 레이블 속성 텍스트와 다른 글꼴을 관리 할 수 있다는 사실을 알고 :
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"Hello. That is a test attributed string."];
[str addAttribute:NSBackgroundColorAttributeName value:[UIColor yellowColor] range:NSMakeRange(3,5)];
[str addAttribute:NSForegroundColorAttributeName value:[UIColor greenColor] range:NSMakeRange(10,7)];
[str addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Bold" size:20.0] range:NSMakeRange(20, 10)];
agendaLabel.attributedText = str;
을하지만, 여기에 내가 시간을 가지고 많은 양의 데이터와 많은 장소를 가지고, 명시 적으로 범위를 설정하지 않고 문자열에있는 시간을 대담하게해야합니다.
오전 7시에서 오전 7시 15분까지 조식
오전 7시 반 - 회의 오후 12시 반 컨퍼런스
저는 대량 데이터에 위와 같이 많은 장소가 있습니다.
와우 작동, 고맙습니다. – user2732294