-
Notifications
You must be signed in to change notification settings - Fork 0
/
NIBadgeView.html
231 lines (217 loc) · 11.1 KB
/
NIBadgeView.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6-nimbuskit"/>
<title>NimbusKit: NIBadgeView Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="appledocs.css" rel="stylesheet" type="text/css"/>
<link href="nimbuskit.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24278774-1']);
_gaq.push(['_setDomainName', 'nimbuskit.info']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<a href="index.html"><img style="float:left" src="nimbus128.png" width="80" height="80" /></a>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">NimbusKit
 <span id="projectnumber">1.2.1 - <a href="http://github.com/jverkoey/nimbus">Fork Nimbus on Github</a> - <a href="http://wiki.nimbuskit.info/">Visit the Nimbus Wiki</a></span>
</div>
<div id="projectbrief">The iOS framework that grows only as fast as its documentation</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6-nimbuskit -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('NIBadgeView.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="classNIBadgeView-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">NIBadgeView Class Reference<div class="ingroups"><a class="el" href="NimbusBadge.html">Nimbus Badge</a></div></div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>A view that mimics the iOS notification badge style. </p>
<p>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.</p>
<p>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.</p>
<div class="image">
<img src="badge.png" alt="badge.png"/>
<div class="caption">
A default NIBadgeView</div></div>
<div class="image">
<img src="badgetinted.png" alt="badgetinted.png"/>
<div class="caption">
A NIBadgeView on tintColor-supporting devices</div></div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Tasks</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Accessing the Text Attributes</div></td></tr>
<tr class="memitem:text"><td class="memItemLeft" align="right" valign="top">NSString * </td><td class="memItemRight" valign="bottom"><a class="el" href="NIBadgeView.html#text">text</a> <span class="suffix">property</span></td></tr>
<tr class="separator:text"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:font"><td class="memItemLeft" align="right" valign="top">UIFont * </td><td class="memItemRight" valign="bottom"><a class="el" href="NIBadgeView.html#font">font</a> <span class="suffix">property</span></td></tr>
<tr class="separator:font"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:textColor"><td class="memItemLeft" align="right" valign="top">UIColor * </td><td class="memItemRight" valign="bottom"><a class="el" href="NIBadgeView.html#textColor">textColor</a> <span class="suffix">property</span></td></tr>
<tr class="separator:textColor"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader">Accessing the Badge Attributes</div></td></tr>
<tr class="memitem:tintColor"><td class="memItemLeft" align="right" valign="top">UIColor * </td><td class="memItemRight" valign="bottom"><a class="el" href="NIBadgeView.html#tintColor">tintColor</a> <span class="suffix">property</span></td></tr>
<tr class="separator:tintColor"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:shadowColor"><td class="memItemLeft" align="right" valign="top">UIColor * </td><td class="memItemRight" valign="bottom"><a class="el" href="NIBadgeView.html#shadowColor">shadowColor</a> <span class="suffix">property</span></td></tr>
<tr class="separator:shadowColor"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:shadowOffset"><td class="memItemLeft" align="right" valign="top">CGSize </td><td class="memItemRight" valign="bottom"><a class="el" href="NIBadgeView.html#shadowOffset">shadowOffset</a> <span class="suffix">property</span></td></tr>
<tr class="separator:shadowOffset"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:shadowBlur"><td class="memItemLeft" align="right" valign="top">CGFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="NIBadgeView.html#shadowBlur">shadowBlur</a> <span class="suffix">property</span></td></tr>
<tr class="separator:shadowBlur"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Method Documentation</h2>
<a class="anchor" id="text"></a>
<div class="memitem">
<h3 class="memname">text</h3>
<div class="memdoc">
<p class="abstract">The text displayed within the badge. </p>
<div class="declaration">
@property (nonatomic, copy) NSString* text;</td></tr>
</div>
<h5>Discussion</h5>
<p>As with a UILabel you should call sizeToFit after setting the badgeView properties so that it will update its frame to fit the contents. </p>
</div>
</div>
<a class="anchor" id="font"></a>
<div class="memitem">
<h3 class="memname">font</h3>
<div class="memdoc">
<p class="abstract">The font of the text within the badge. </p>
<div class="declaration">
@property (nonatomic, strong) UIFont* font;</td></tr>
</div>
<h5>Discussion</h5>
<p>The default font is:</p>
<p>iOS 6: [UIFont boldSystemFontOfSize:17] iOS 7: [UIFont systemFontOfSize:16]</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="NIBadgeView.html#text" title="The text displayed within the badge. ">text</a> </dd></dl>
</div>
</div>
<a class="anchor" id="textColor"></a>
<div class="memitem">
<h3 class="memname">textColor</h3>
<div class="memdoc">
<p class="abstract">The color of the text in the badge. </p>
<div class="declaration">
@property (nonatomic, strong) UIColor* textColor;</td></tr>
</div>
<h5>Discussion</h5>
<p>The default color is [UIColor whiteColor]. </p>
</div>
</div>
<a class="anchor" id="tintColor"></a>
<div class="memitem">
<h3 class="memname">tintColor</h3>
<div class="memdoc">
<p class="abstract">The tint color of the badge. </p>
<div class="declaration">
@property (nonatomic, strong) UIColor* tintColor;</td></tr>
</div>
<h5>Discussion</h5>
<p>This is the color drawn within the badge's borders.</p>
<p>The default color is</p>
<p>iOS 6: [UIColor redColor]. iOS 7: self.tintColor</p>
<p>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. </p>
</div>
</div>
<a class="anchor" id="shadowColor"></a>
<div class="memitem">
<h3 class="memname">shadowColor</h3>
<div class="memdoc">
<p class="abstract">The shadow color of the badge. </p>
<div class="declaration">
@property (nonatomic, strong) UIColor* shadowColor;</td></tr>
</div>
<h5>Discussion</h5>
<p>This is the shadow drawn beneath the badge's outline.</p>
<p>The default color is</p>
<p>iOS 6: [UIColor colorWithWhite:0 alpha:0.5]. iOS 7: nil</p>
<p>On devices that support global tintColor (iOS 7) it is possible, though not encouraged, to use a shadow on badges.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="NIBadgeView.html#shadowOffset" title="The shadow offset (measured in points) for the badge. ">shadowOffset</a> </dd>
<dd>
<a class="el" href="NIBadgeView.html#shadowBlur" title="The shadow blur (measured in points) for the badge. ">shadowBlur</a> </dd></dl>
</div>
</div>
<a class="anchor" id="shadowOffset"></a>
<div class="memitem">
<h3 class="memname">shadowOffset</h3>
<div class="memdoc">
<p class="abstract">The shadow offset (measured in points) for the badge. </p>
<div class="declaration">
@property (nonatomic) CGSize shadowOffset;</td></tr>
</div>
<h5>Discussion</h5>
<p>This is the offset of the shadow drawn beneath the badge's outline.</p>
<p>The default value is CGSizeMake(0, 3.f).</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="NIBadgeView.html#shadowColor" title="The shadow color of the badge. ">shadowColor</a> </dd>
<dd>
<a class="el" href="NIBadgeView.html#shadowBlur" title="The shadow blur (measured in points) for the badge. ">shadowBlur</a> </dd></dl>
</div>
</div>
<a class="anchor" id="shadowBlur"></a>
<div class="memitem">
<h3 class="memname">shadowBlur</h3>
<div class="memdoc">
<p class="abstract">The shadow blur (measured in points) for the badge. </p>
<div class="declaration">
@property (nonatomic) CGFloat shadowBlur;</td></tr>
</div>
<h5>Discussion</h5>
<p>This is the blur of the shadow drawn beneath the badge's outline.</p>
<p>The default value is 3.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="NIBadgeView.html#shadowOffset" title="The shadow offset (measured in points) for the badge. ">shadowOffset</a> </dd>
<dd>
<a class="el" href="NIBadgeView.html#shadowColor" title="The shadow color of the badge. ">shadowColor</a> </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<script type="text/javascript" src="widget.js"></script>
</body>
</html>