Tunyk Pavel
Tunyk Pavel

Reputation: 2493

UITabBarItem title in centre of title, not at bottom

I want to make place tabbaritem.title in centre of item, it's possible? I'm trying make image with text in center and create custom tabbaritem, but it looks awful.Help me please.

Upvotes: 3

Views: 3043

Answers (2)

Claus
Claus

Reputation: 5722

Try with the iOS5 Appearance Proxy:

[[UITabBarItem appearance] setTitlePositionAdjustment:UIOffsetMake(0.0, -2.0)];

Upvotes: 4

MrShoot
MrShoot

Reputation: 863

Have you tried using setTitlePositionAdjustment::[UIOffsetMake(<#CGFloat horizontal#>, <#CGFloat vertical#>)] ?

If that doesn't work, why don't you create your own control? Have it subclass NSObject and implement the UIImageView with the centered text

Upvotes: 0

Related Questions