在程序的ICON上显示数字


/ Published in: iPhone
Save to your folder(s)



Copy this code and paste it in your 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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.