NimbusKit
1.2.1 - Fork Nimbus on Github - Visit the Nimbus Wiki
The iOS framework that grows only as fast as its documentation
|
A view that mimics the iOS notification badge style.
Any NSString can be displayed in this view, though in practice you should only show numbers ranging from 1...99 or the string "99+". Apple is quite consistent about using the red badge views to represent notification badges, so you should do your best not to attach additional meaning to the red badge.
On devices running operating systems that support the tintColor property on UIViews, these badges will use the tintColor by default. This behavior may be overwritten by assigning a tint color explicitly.
Tasks | |
Accessing the Text Attributes | |
NSString * | text property |
UIFont * | font property |
UIColor * | textColor property |
Accessing the Badge Attributes | |
UIColor * | tintColor property |
UIColor * | shadowColor property |
CGSize | shadowOffset property |
CGFloat | shadowBlur property |
The text displayed within the badge.
As with a UILabel you should call sizeToFit after setting the badgeView properties so that it will update its frame to fit the contents.
The font of the text within the badge.
The default font is:
iOS 6: [UIFont boldSystemFontOfSize:17] iOS 7: [UIFont systemFontOfSize:16]
The color of the text in the badge.
The default color is [UIColor whiteColor].
The tint color of the badge.
This is the color drawn within the badge's borders.
The default color is
iOS 6: [UIColor redColor]. iOS 7: self.tintColor
On devices that support global tintColor (iOS 7) the global tint color is used unless a tint color has been explicitly assigned to this badge view, in which case the assigned tint color will be used.
The shadow color of the badge.
This is the shadow drawn beneath the badge's outline.
The default color is
iOS 6: [UIColor colorWithWhite:0 alpha:0.5]. iOS 7: nil
On devices that support global tintColor (iOS 7) it is possible, though not encouraged, to use a shadow on badges.
The shadow offset (measured in points) for the badge.
This is the offset of the shadow drawn beneath the badge's outline.
The default value is CGSizeMake(0, 3.f).
The shadow blur (measured in points) for the badge.
This is the blur of the shadow drawn beneath the badge's outline.
The default value is 3.