0
UITableView 셀의 높이를 계산하는 데 다음 코드가 있습니다. 아이폰 OS 5.1.1 UITextView iOS 6에서 ContentSize.Height가 너무 높음
UIFont *textFont = [SettingsManagerUI defaultFontItalicWithSize:14];
UIView *tempView = [[UIView alloc] init];
UITextView *locationText = [[UITextView alloc] init];
UITextView *moreInfoText = [[UITextView alloc] init];
[tempView addSubview:locationText];
[tempView addSubview:moreInfoText];
[locationText setFont:textFont];
[moreInfoText setFont:textFont];
NSString *locationDetails = [MembersSavePartnerDetailsMoreInfoTableCell generateLocationTextWithPartner:partner inLocation:location];
locationText.text = locationDetails;
NSString *moreInfo = partner ? partner.partnerDescription : location.partner.partnerDescription;
moreInfoText.text = moreInfo;
float locationTextHeight = locationText.contentSize.height;
float moreInfoTextHeight = moreInfoText.contentSize.height;
의
locationTextHeight
는 높이가 각각 1,420 및 2,482이다, (88) 및 iOS 6의
moreInfoTextHeight
= 52이다.
iOS 6의 높이가 다른 이유는 무엇이며 어떻게 해결할 수 있습니까?
는 난 그냥 문제가 무엇인지 깨달았다 생각 - 나는 UITextView는 프레임 개체를 초기화 할 필요가 있으므로 콘텐츠 크기에 사용할 너비를 알 수 있습니다. 나는 곧 그것을 시도 할 것이고, 해결책으로 입증되면 대답으로 게시 할 것이다. – Anthony