2011-04-23 7 views
0

UILabel의 외관을 코딩하려고하는데 다른 글꼴을 적용 할 수 없습니다. 재미있는 (또는 짜증나는) 것은 두 번째 UILabel을 추가하면 두 번째 레이블에 글꼴이 적용되지만 첫 번째 UILabel은 적용되지 않는다는 것입니다. 나는 이것에 약간 미치고있다. .. 특히하려고 생각하면 폰트 크기는 바뀌지 않을 것이다. (내있는 viewDidLoad에 있음)cocoa-touch : 글꼴이 적용되지 않는 이유는 무엇입니까?

내 코드 : 당신이 글꼴 속성을 설정하는 경우가 잘못된 변수 이름을 지정하는

NSString* dateWeekDay = @"MON"; 
CGRect dateWeekDayFrame = CGRectMake(183, 12, 34, 21); 
viewNoteDateWeekDay = [[UILabel alloc] initWithFrame:dateWeekDayFrame]; 
viewNoteDateWeekDay.text = dateWeekDay; 
viewNoteDateWeekDay.textColor = [UIColor blackColor]; 
viewNoteTitle.font = [UIFont fontWithName:@"Helvetica Neue" size:70.0f]; // I know this size is crazy, but it's just to show that it has no effect whatsoever... 
viewNoteDateWeekDay.transform = CGAffineTransformMakeRotation((-90 * M_PI)/180); 
viewNoteDateWeekDay.backgroundColor = [UIColor clearColor]; 

NSString* dateDay = @"01"; 
CGRect dateDayFrame = CGRectMake(209, 3, 47, 50); 
viewNoteDateDay = [[UILabel alloc] initWithFrame:dateDayFrame]; 
viewNoteDateDay.text = dateDay; 
viewNoteDateDay.textColor = [UIColor blackColor]; 
viewNoteDateDay.font = [UIFont fontWithName:@"Helvetica Neue" size:33.0f]; 
viewNoteDateDay.backgroundColor = [UIColor clearColor]; 

NSString* dateMonth = @"SEPTEMBER"; 
CGRect dateMonthFrame = CGRectMake(249, 6, 93, 31); 
viewNoteDateMonth = [[UILabel alloc] initWithFrame:dateMonthFrame]; 
viewNoteDateMonth.text = dateMonth; 
viewNoteDateMonth.textColor = [UIColor blackColor]; 
viewNoteDateMonth.font = [UIFont fontWithName:@"Helvetica Neue" size:12.0f]; 
viewNoteDateMonth.backgroundColor = [UIColor clearColor]; 

enter image description here

답변

1

. 귀하의 코드는 다음과 같습니다 : viewNoteTitle.font = ... 읽어야 할 때 viewNoteDateWeekDay.font = ...

+0

고마워요 ... 가끔은 더 이상 똑바로 생각할 수 없습니다. 당신의 도움은 대단히 감사합니다! –

+0

내 기쁨. 눈의 두 번째 세트를 얻는 것이 항상 도움이됩니다. – Kyle

관련 문제