Posted By

iswear_wxp on 08/25/10


Tagged

icon iphone


Versions (?)

在程序的ICON上显示数字


 / Published in: iPhone
 

URL: http://www.cnblogs.com/tracy-e/archive/2010/08/23/1806302.html

  1. UIApplication的一个属性,就查了下API,果然找到了这个属性:
  2.  
  3. @ property(nonatomic) NSInteger applicationIconBadgeNumber; // set to 0 to hide. default is 0
  4.  
  5.  
  6.  
  7. 就结合手上正在做的项目,看看效果(在程序退出时,显示今日要处理的事件数目):
  8.  
  9. - (void)applicationDidEnterBackground:(UIApplication *)application{
  10.  
  11. [[UIApplication sharedApplication] setApplicationIconBadgeNumber:
  12.  
  13. _homeViewController._dayViewController.eventCountOfToday];
  14.  
  15. }

Report this snippet  

You need to login to post a comment.