2011-11-27 52 views

回答

3

考慮繼承UITabBarItem和自己繪製它

+6

UITabBarItem甚至不從UIView的繼承。你能否澄清你的建議? –

0

薩沙保盧斯寫了一個偉大的階級,不只是這一點:

CustomBadge2.0

當然你也可以聯合子類UITabBarItem使用它。

0

可以看看裏面here。這裏自定義項目被添加爲UILabel。考慮在這裏使用你自己的選擇。

演示

enter image description here

,只有兩個行代碼,讓你去

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 

    //supplying the animation parameter 
    [UITabBarItem setDefaultAnimationProvider:[[DefaultTabbarBadgeAnimation alloc] init]]; 
    [UITabBarItem setDefaultConfigurationProvider:[[DefaultSystemLikeBadgeConfiguration alloc] init]]; 

    //rest of your code goes following... 

    return YES; 
}