iPhone 주소록과 비슷한 글꼴로 uitableviewcell에 두 단어를 표시하고 싶습니다. 예 : 존 뷰캐넌UITableViewCell 여러 글꼴 표시
답변
어느
편집 .. 두 UILables를 사용한다, 또는 NSAttributedString은을 그릴 OHAttributedLabel를 사용할 수 있습니다
당신은 UILabel의 크기를 사용하여 동적으로 변경할 수
CGSize expectedLabelSize = [titleLabel.text sizeWithFont:titleLabel.font];
titleLabel.frame = CGRectMake(xBase, yBase, expectedLabelSize.width, expectedLabelSize.height);
감사 \ 내 편집 대답을 확인 ?? 나는 아이폰 addres 책과 같은 표시 싶어요. – Jack
도움 .. – KingofBliss
잭 cell.textLabel.text 및 cell.textLabel.DetailText .. 이들은 하나의 셀에 두 개의 레이블이 있습니다.
각 레이블은 글꼴을 만들고 해당 레이블의 글꼴 속성에 적용됩니다.
+ (UIFont *)fontWithName:(NSString *)fontName size:(CGFloat)fontSize
그러나 라벨의 크기를 잘 고정됩니다 :) 환영 @jack – Jack
사용자 지정 UITableViewCell 만들기.
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
}
//Initialize String for Displaying
//NSString *str =
UILabel *lbl;
if ([cell.contentView.subviews count] == 0) {
//Label alloc and init with frame
//lbl = [[UILabel] alloc] initWithFrame:CGRectMake(x,y,width,height)];
//Cofigure Label (text, font, etc.)
lbl.text = str;
//lbl.font = font;
//Add subview
[cell.contentView addSubview:lbl];
//Release
[lbl release];
}
else {
lbl = [cell.contentView.subviews objectAtIndex:0];
lbl.text = str; //Do only set variable value.
}
return cell;
}
감사합니다 .. dis는 나에게 약간의 생각을 줬다. – Jack
- 1. 여러 UITableViewCell 유형 구현
- 2. 여러 맞춤형 UITableViewCell 사용하기
- 3. 사용자 정의 UITableViewCell 레이블 글꼴 문제
- 4. UITableViewCell 액세서리 공개 표시 숨기기/표시
- 5. UItableViewCell 체크 표시 다시 설정
- 6. 사용자 지정 UITableViewCell 표시 문제가
- 7. Java 글꼴 표시 문제
- 8. 오른쪽에서 왼쪽으로 표시 글꼴
- 9. iPhone에서 글꼴 표시
- 10. 사용자 정의 UITableViewCell 여러 섹션
- 11. JasperReports - 여러 글꼴 지정?
- 12. AppleScript - 모든 글꼴 목록 표시
- 13. Itext 아랍어 글꼴 물음표로 표시
- 14. asp.net mvc에서 굵게 글꼴 표시
- 15. UITableViewCell - 재정렬 컨트롤 옆에 액세서리보기 표시
- 16. UITableViewCell, 그룹화 된 스타일로 UIMenuController 표시
- 17. UITextView에서 여러 글꼴 스타일을 사용할 수 있습니까?
- 18. UITableViewCell textLabel 잘림
- 19. Sifr3 : 한 줄에 여러 글꼴
- 20. WPF, 여러 컨트롤의 글꼴 스타일
- 21. UITableViewCellStyleValue2 스타일을 사용하는 여러 줄 UITableViewCell
- 22. UITableViewCell 할당
- 23. uitableviewcell 업데이트
- 24. UITableView에서 글꼴 크기 변경 애니메이션하기
- 25. 특수 문자가있는 글꼴 표시 - UTF-8
- 26. .NET FontDialog에서 기본이 아닌 글꼴 표시
- 27. iOS UITableViewCell 액세서리가 왼쪽에 있습니까?
- 28. 사용자 지정 렌더링에서 텍스트 레이아웃 UITableViewCell
- 29. UITableViewCell 사용자 정의
- 30. sifr3을 사용하여 한 줄에 여러 글꼴 사용
이 정말 – KingofBliss