Aniket Bhosale
Aniket Bhosale

Reputation: 119

How to increase the size of UITabBarItem in iphone?

I want to increase the Text size of UITabBarItem in my application.It is not visible clearly with its default color and size.

I tried this code but give me error -->UITabBar for instant message does not declare method with selector 'setTitleTextAttributes'.

Does any know how to do it?

[yourTabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
    [UIColor whiteColor], UITextAttributeTextColor, 
    [NSValue valueWithUIOffset:UIOffsetMake(0,0)], UITextAttributeTextShadowOffset, 
    [UIFont fontWithName:@"Helvetica" size:18.0], UITextAttributeFont, nil]
    forState:UIControlStateNormal];

Upvotes: 0

Views: 1334

Answers (3)

vishiphone
vishiphone

Reputation: 750

For that you should create dynamic tab bar using UITabbar class.

.Using this You can allow own size text ,image,color.

Upvotes: 0

Hailei
Hailei

Reputation: 42153

setTitleTextAttributes:forState: is only available in iOS 5.0 or later. Please refer to UIBarItem Class Reference (UITabBarItem is subclass of UIBarItem). For prior versions of iOS, I think you'd better create your own customized tab bar.

And you may also want to try other methods from the answers in Changing font size of tabbaritem.

Upvotes: 0

sky1224
sky1224

Reputation: 158

I think the default size is fully conveninet for the user. Anyway you want, maybe you should make your own <Tabbar> with UIView, UIButtons and UITabbar-style images.

Upvotes: 1

Related Questions