모든보기 컨트롤러의 모든 탐색 바에 대한 app-delegate에서 내 앱의 글꼴을 일반적으로 변경했습니다. 당신이 당신의 네비게이션 바 제목 글꼴을 모두 변경 꺼리지 않는 경우에 다음과 같은 것을 넣어 applicationDidFinishLaunching:withOptions:
if ([[UINavigationBar class] respondsToSelector:@selector(appearance)])
// set the navigation bar font to "courier-new bold 14"
[[UINavigationBar appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:[UIColor lightGrayColor], UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(1, 0)], UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"CourierNewPS-BoldMT" size:14.0], UITextAttributeFont,
nil]];
업데이트 : 는 당신이이 일 경우에만 해당, 당신은 아마 appearanceWhenContainedIn를 사용하려는 경우 : Alexander Akers가 UIViewController가 UIAppearanceContainer를 상속 받았기 때문에 아래의 주석에서 제안한 인수를 사용합니다. 나는 appearanceWhenContainedIn : UINavigationBar에 포함 된 UIBarButtonItems와 같은 다른 경우에도 작동하므로이 상황에서도 비슷하게 작동해야합니다. 다음과 같이 MFMailComposeViewController
이후
'[UINavigationBar appearanceWhenContainedIn : [MFMailComposeViewController class], nil]'? –
해당 코드는 메일 작성보기 컨트롤러에 포함되어있을 때만 탐색 모음의 모양을 변경합니다. –
@AlexsanderAkers, 제안을 반영하도록 답변을 업데이트했습니다. 나는 appearanceWhenContainedIn : UINavigationBar의 UIBarButtonItem에 대한 경험이 있습니다. 나는이 유형의 경우에는 사용하지 않았지만 실제로 작동해야합니다. –