The name UITabBarItem is in the center of the name, not at the bottom

I want to place tabbaritem.title in the center of the subject, is this possible? I'm trying to make an image with text in the center and create my own tabbaritem, but it looks awful. Help me please.

+3
source share
2 answers

Try with iOS5 proxy:

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

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

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

0
source

All Articles