Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 986 Bytes

README.md

File metadata and controls

23 lines (18 loc) · 986 Bytes

CustomBadge

CustomBadge is a custom badge view implementation for UITabBar in iOS. It is a tiny library, simple and easy to use. It is an class extension of UITabBar and few apis are provided.

Usage

  1. Set the width of tab bar icon and the top of badge view, so it can calculate and position the badge properly
[tabBar setTabIconWidth:29];
[tabBar setBadgeTop:9];
  1. Set badge type and number
// type is an CustomBadgeType enum type, it has 3 values
// kCustomBadgeStyleRedDot  represents a slightly notify without number for user
// kCustomBadgeStyleNumber  represents a notify with a number for user, and the badge will adjust its width automatically and show '...' when  the number is larger than 99
// kCustomBadgeStyleNone    represents no badge view
[selftabBar setBadgeStyle:type value:number atIndex:index];

That's very easy to use , and here is the effects: demo