当前位置: 首页 > news >正文

网站上那些轮播图视频怎么做的wordpress建站费用

网站上那些轮播图视频怎么做的,wordpress建站费用,建设部质量监督官方网站,免费做调查的网站有哪些本地通知#xff0c;local notification#xff0c;用于基于时间行为的通知#xff0c;比如有关日历或者todo列表的小应用。另外#xff0c;应用如果在后台执行#xff0c;iOS允许它在受限的时间内运行#xff0c;它也会发现本地通知有用。比如#xff0c;一个应用…本地通知local notification用于基于时间行为的通知比如有关日历或者todo列表的小应用。另外应用如果在后台执行iOS允许它在受限的时间内运行它也会发现本地通知有用。比如一个应用在后台运行向应用的服务器端获取消息当消息到达时通过本地通知机制通知用户。 本地通知是UILocalNotification的实例主要有三类属性 scheduled time时间周期用来指定iOS系统发送通知的日期和时间notification type通知类型包括警告信息、动作按钮的标题、应用图标上的badge数字标记和播放的声音自定义数据本地通知可以包含一个dictionary类型的本地数据。对本地通知的数量限制iOS最多允许最近本地通知数量是64个超过限制的本地通知将被iOS忽略。 如果就写个简单的定时提醒是很简单的比如这样 示例写的很简单启动应用后就发出一个定时通知10秒后启动。这时按Home键退出一会儿就会提示上图的提示信息。如果应用不退出则无效。 代码如下 UILocalNotification *notification[[UILocalNotification alloc] init]; if (notification!nil) {     NSLog( support local notification);     NSDate *now[NSDate new];     notification.fireDate[now addTimeInterval:10];     notification.timeZone[NSTimeZone defaultTimeZone];     notification.alertBody该去吃晚饭了;     [[UIApplication sharedApplication]   scheduleLocalNotification:notification];   更详细的代码见官方文档《Scheduling, Registering, and Handling Notifications》可以设置比如声音比如用户定义数据等。 设置更多本地通知的信息   设置icon上数字。- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {        // Override point for customization after application launch.     /   application.applicationIconBadgeNumber 0;     // Add the view controller’s view to the window and display.     [self.window addSubview:viewController.view];     [self.window makeKeyAndVisible];     return YES; } 添加通知时间通知类型取消通知#pragma mark – #pragma mark onChageValue -(IBAction)onChangeValue:(id)sender {     UISwitch *switch1(UISwitch *)sender;     if (switch1.on) {         UILocalNotification *notification[[UILocalNotification alloc] init];         NSDate *now1[NSDate date];          notification.timeZone[NSTimeZone defaultTimeZone];         notification.repeatIntervalNSDayCalendarUnit;         notification.applicationIconBadgeNumber 1;         notification.alertAction NSLocalizedString(显示, nil);         switch (switch1.tag) {             case 0:             {                 notification.fireDate[now1 dateByAddingTimeInterval:10];                 notification.alertBodyself.myLable1.text;             }                 break;             case 1:             {                 notification.fireDate[now1 dateByAddingTimeInterval:20];                 notification.alertBodyself.myLable2.text;             }                 break;             case 2:             {                 notification.fireDate[now1 dateByAddingTimeInterval:30];                 notification.alertBodyself.myLable3.text;             }                 break;             default:                 break;         }         [notification setSoundName:UILocalNotificationDefaultSoundName];         NSDictionary *dict [NSDictionary dictionaryWithObjectsAndKeys:                               [NSString stringWithFormat:%d,switch1.tag], key1, nil];         [notification setUserInfo:dict];         [[UIApplication sharedApplication]   scheduleLocalNotification:notification];     }else {         NSArray *myArray[[UIApplication sharedApplication] scheduledLocalNotifications];         for (int i0; i[myArray count]; i) {             UILocalNotification    *myUILocalNotification[myArray objectAtIndex:i];             if ([[[myUILocalNotification userInfo] objectForKey:key1] intValue]switch1.tag) {                 [[UIApplication sharedApplication] cancelLocalNotification:myUILocalNotification];             }         }     } }   ***************Demo************** #import Foundation/Foundation.h interface LocalNotifications : NSObject // 设置本地通知 (void)registerLocalNotification:(NSInteger)alertTime; // 取消当前通知 (void)cancelLocalNotificationWithKey:(NSString *)key; end   #import LocalNotifications.h // 1.如果需要设置多个通知key就不能写成宏定义了需要动态生成 // 2.以便在用户关闭某个通知时可以移除对应的本地通知 #define KAlarmLocalNotificationKey KAlarmLocalNotificationKey   implementation LocalNotifications   // 设置本地通知 (void)registerLocalNotification:(NSInteger)alertTime {     UILocalNotification *notification [[UILocalNotification alloc] init];     // 设置触发通知的时间     NSDate *fireDate [NSDate dateWithTimeIntervalSinceNow:alertTime];          notification.fireDate fireDate;     // 时区     notification.timeZone [NSTimeZone defaultTimeZone];     // 设置重复的间隔     notification.repeatInterval kCFCalendarUnitSecond;     // 通知内容     notification.alertBody   发现新版本请前往更新;     notification.applicationIconBadgeNumber 1;     // 通知被触发时播放的声音     notification.soundName UILocalNotificationDefaultSoundName;     // 通知参数     NSDictionary *userDict [NSDictionary dictionaryWithObject:是否前往更新 forKey:key];     notification.userInfo userDict;          // ios8后需要添加这个注册才能得到授权     if ([[UIApplication sharedApplication] respondsToSelector:selector(registerUserNotificationSettings:)]) {         UIUserNotificationType type UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound;         UIUserNotificationSettings *settings [UIUserNotificationSettings settingsForTypes:type categories:nil];         [[UIApplication sharedApplication] registerUserNotificationSettings:settings];         // 通知重复提示的单位可以是天、周、月         notification.repeatInterval NSCalendarUnitDay;     } else {         // 通知重复提示的单位可以是天、周、月         notification.repeatInterval NSDayCalendarUnit;     }          // 执行通知注册     [[UIApplication sharedApplication] scheduleLocalNotification:notification]; } // 取消某个本地推送通知 (void)cancelLocalNotificationWithKey:(NSString *)key {     // 获取所有本地通知数组     NSArray *localNotifications [UIApplication sharedApplication].scheduledLocalNotifications;          for (UILocalNotification *notification in localNotifications) {         NSDictionary *userInfo notification.userInfo;         if (userInfo) {             // 根据设置通知参数时指定的key来获取通知参数             NSString *info userInfo[key];                          // 如果找到需要取消的通知则取消             if (info ! nil) {                 [[UIApplication sharedApplication] cancelLocalNotification:notification];                 break;             }         }     } } end转载于:https://www.cnblogs.com/xmqios/p/5036395.html
http://www.yutouwan.com/news/429791/

相关文章:

  • 山东省建设部网站官网如何做自己的小说网站
  • 把网站做成手机版电子商务网站建设及推广
  • 阿里云linux主机如何添加2个网站贵阳建设银行网站
  • 游戏租号网站开发网站的关于我们页面
  • 查看网站是否被k东莞网站设计排行榜
  • 手机网站带后台源代码建设银行商城网站
  • 做游戏网站需要注意的问题中山河北建设信息网站
  • 企业网站制作服务南昌网站改版
  • 一个公司可以做几个网站深圳手机网站建设哪家好
  • 湖南微信网站建设wordpress 导航特效
  • 如何看网站的语言成立公司注册资金要求
  • 渭南市住建设局网站网页版拍图搜题
  • 建站平台哪个好外网网站有什么好的推荐
  • 网站设计 app开发网站开发工程师面试问题
  • php mysql 网站开发实例教程二级域名分发
  • 阿里云网站备案要多久校园二手物品交易网站怎么做
  • 建设电影播放网站建设公司网站的申请
  • 成都网站建设优创智汇统一企业信息管理系统网站
  • 如何申请免费域名做网站设计师投资做项目网站
  • 档案网站建设经验定制一款软件需要多少钱
  • 现在网站开发用什么dede导入wordpress
  • wordpress分类目录名称福州短视频seo方法
  • 技术网站源码wordpress百度霸屏全网推广
  • 免费建网站平台哪个好网站如何添加二维码
  • 怎样制作网站建设方案网站建设的公司太多了
  • 网站搭建详细步骤网站的首页面设计
  • 效果图网站有哪些怎么用一个主机做多个网站
  • 网站建设销售开场白用divid做网站代码
  • 网站内容建设的核心和根本是编程教学
  • 网站制作与管理技术标准实训教程wordpress andriod