2014-07-21 2 views
1

How to change the unselected tabbaritem color in iOS7? 이것은 작동하지 않습니다.텍스트를 맞춤 글꼴로 변경하고 iOS 7에서 맞춤 색상을 사용하는 방법

나는이

[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:[ThemeManager customFont] size:10.0f], 
                NSForegroundColorAttributeName : [UIColor greenColor] 
                } forState:UIControlStateSelected]; 

색상의 변화가 아니라 내가 사용하고 사용자 지정 글꼴을 시도하고있다.

+0

나는 최근에 똑같은 것을 조사해 보았습니다. 결국 나는 불가능하다는 결론을 내 렸습니다. ( – Fogmeister

+0

나는 같은 문제를 겪었습니다. 이것은 iOS 개발의 첫 벤처이며 스티브 잡스의 소장을 통한 마술 학교 버스와 같은 것입니다. – clocksmith

+0

iOS 개발은 쉬운 일을 찾기가 어렵고 어려운 일이 쉽습니다. – user1898829

답변

1

해결책을 찾았습니다.

[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:[ThemeManager customFont] size:17.0f], 
                NSForegroundColorAttributeName: [UIColor greenColor]} 
             forState:UIControlStateSelected]; 

[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:[ThemeManager customFont] size:17.0f], 
                NSForegroundColorAttributeName: [UIColor blackColor]} 
             forState:UIControlStateNormal]; 
+0

항목을 선택한 다음 다른 항목을 선택하면 그대로 유지됩니까? 작동하는 항목을 찾았을 때 선택이 변경 될 때까지만 작동하는 것처럼 보였습니다. . – Fogmeister

+1

그렇습니다. 계속 그럴 겁니다. – user1898829

+0

굉장하고 고마워요. D – Fogmeister

관련 문제