2011-08-25 6 views
1

UIToolbar에서 글꼴 크기를 변경하는 방법이 있습니까? 내 텍스트가 맞지 않아서 크기를 줄여야합니다.UIToolbar 변경 글꼴 크기 - iOS

감사합니다.

+0

텍스트를 다시 작성 하시겠습니까? 글꼴은 이유 때문에 그 크기입니다. –

+0

있습니다. 하지만 차라리 작게하려고합니다. 오직 조금씩 – Corey

답변

1

다음은 한 예입니다. 내가 원하는 것은 무엇인지 모르겠지만 툴바에서 uibarbuttonitem의 글꼴 크기를 조절할 수 있습니다.

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,10,15)]; 
      label.font = [UIFont systemFontOfSize:15.0]; 
      label.textColor = [UIColor blackColor]; 
      label.backgroundColor = [UIColor clearColor]; 
      //label.adjustsFontSizeToFitWidth = YES; 
      label.textAlignment = UITextAlignmentCenter; 
      label.text = @"Bar"; 


    UIBarButtonItem *item2 = [[UIBarButtonItem alloc] 
    initWithCustomView:label]; 
관련 문제