하나의 큰 문자를 표시하는 UILabel을 만들었습니다. clipsToBounds = NO 인 경우에도 마찬가지입니다. 나는 여전히 클리핑을한다.UILabel sizeWithFont : 문제가 발생했습니다. 이탤릭체 텍스트 자르기
참조 링크 :
CGSize fBounds = [myLabel.text sizeWithFont:cFont];
글꼴의 경계의 구형해야합니다 것을 얻을 :
http://img341.imageshack.us/img341/5310/screenshot20100814at243.png는 다음 코드를 사용했다. 그리고 라벨로 그려 : 아래 이미지
myLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 280, 300)];
myLabel.clipsToBounds = NO;
myLabel.numberOfLines = 1;
myLabel.textAlignment = UITextAlignmentCenter;
myLabel.adjustsFontSizeToFitWidth = YES;
myLabel.minimumFontSize = 10;
myLabel.text = @"A";
myLabel.font = [UIFont fontWithName:@"CourierNewPSMT" size:300];
myLabel.textColor = [UIColor blackColor];
myLabel.backgroundColor = [UIColor colorWithRed:1 green:.5 blue:0 alpha:.5];
, sizeWithFont에서 리턴 크기는 반투명 청색 사각형 오버레이에 의해 렌더링된다. 알 수 있듯이 기울임 꼴 글꼴 (이 경우 Verdana-BoldItalic)을 사용하면 sizeWithFont가 반환하는 문자보다 문자가 확장됩니다. 또한, UILabel의 프레임 (주황색)은 문자를 클립합니다. 생각? 어쩌면 나는 어떤 텍스트 그리기 루틴을 무시할 수있다. 이 사과 문제처럼
UIButton.titleLabel clipping text problem
그냥 이것에 부딪 혔습니다. RDAR 제출물 인 것처럼 보입니다. –