2011-08-05 7 views

답변

1

어느

편집 .. 두 UILables를 사용한다, 또는 NSAttributedString은을 그릴 OHAttributedLabel를 사용할 수 있습니다

당신은 UILabel의 크기를 사용하여 동적으로 변경할 수

CGSize expectedLabelSize = [titleLabel.text sizeWithFont:titleLabel.font]; 
titleLabel.frame = CGRectMake(xBase, yBase, expectedLabelSize.width, expectedLabelSize.height); 
+0

감사 \ 내 편집 대답을 확인 ?? 나는 아이폰 addres 책과 같은 표시 싶어요. – Jack

+0

도움 .. – KingofBliss

0

cell.textLabel.textcell.textLabel.DetailText .. 이들은 하나의 셀에 두 개의 레이블이 있습니다.

0

각 레이블은 글꼴을 만들고 해당 레이블의 글꼴 속성에 적용됩니다.

+ (UIFont *)fontWithName:(NSString *)fontName size:(CGFloat)fontSize 
+0

그러나 라벨의 크기를 잘 고정됩니다 :) 환영 @jack – Jack

0

사용자 지정 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; 
    } 
+0

감사합니다 .. dis는 나에게 약간의 생각을 줬다. – Jack

관련 문제