이 코드는 응용 프로그램 내에서 UINavigationBar
의 색을 변경할 수 있습니다. 그러나 은UINavigationController
(내는 UIStoryboard
에서 사용) UINavigationBar
의 UIColor
을 변경하지 않는 것으로 나타났습니다.UINavigationController 전역 및 프로그래밍 방식으로 탐색 모음 색조 색 변경
UIColor* navBarColor = [UIColor colorWithRed:arc4random()%100/100.0
green:arc4random()%100/100.0
blue:arc4random()%100/100.0
alpha:1];
[[UINavigationBar appearance] setTintColor:navBarColor];
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlackTranslucent];
[[UINavigationBar appearance] setAlpha:0.7];
UINavigationController's
탐색 모음의 appearance
개체에 액세스하는 방법이 있나요? 개별 컨트롤러의 색조를 설정하는 방법을 알고 있지만 어떻게 보일지 전체적으로 제어하려고합니다.
업데이트 : 이 내 실수는, 코드가 모든 UINavigationBars
의 UIColor
을 변경 않습니다, 그러나 그것은 (모달 뷰 컨트롤러를 제시 예를 들어) 덮여 발견 할 수있는 루트 탐색 컨트롤러를 필요로하고이됩니다 다시 무승부 그 자체로 새로운 UIColors
!
감사합니다.
참고. – thomers