1

誰もがAppearanceプロキシオブジェクトの使用方法を知っていますか

[[UITabBar appearance] set....];

UITabBarの選択された/選択されていないラベルの色、フォント、影をカスタマイズするには?

どうもありがとう。

4

1 に答える 1

2

for eachのタブバー項目オブジェクトにアクセスするUITabBarUIViewController

これは iOS5.0 以降でのみ機能します。

if ([self.tabBarItem respondsToSelector:@selector(setTitleTextAttributes:)]) {
    NSLog(@"*** Support method(iOS 5): setTitleTextAttributes:");
    [self.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                [UIFont fontWithName:@"AmericanTypewriter" size:20.0f], UITextAttributeFont,
                                                [UIColor blackColor], UITextAttributeTextColor,
                                                [UIColor grayColor], UITextAttributeTextShadowColor,
                                                [NSValue valueWithUIOffset:UIOffsetMake(0.0f, 1.0f)], UITextAttributeTextShadowOffset,
                                                nil]];
}

5以下https://github.com/boctor/idev-recipes/tree/master/CustomTabBar

于 2012-09-05T10:04:57.880 に答える