标签:
1.navigationItem
if (isBeforeIOS7) { UIButton *yes = [UIButton buttonWithType:UIButtonTypeCustom]; yes.frame = CGRectMake(0,0,40,40); [yes setTitle:@"确定" forState:UIControlStateNormal]; [yes setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; yes.titleLabel.font=[UIFont systemFontOfSize:16]; [yes addTarget: self action: @selector(selectItemReturn:) forControlEvents: UIControlEventTouchUpInside]; UIBarButtonItem*right=[[UIBarButtonItem alloc]initWithCustomView:yes]; self.navigationItem.rightBarButtonItem=right; }else { UIBarButtonItem *editlButton = [[UIBarButtonItem alloc] initWithTitle:@"确定" style:UIBarButtonItemStyleBordered target:self action:@selector(selectItemReturn:)]; self.navigationItem.rightBarButtonItem = editlButton; self.navigationItem.rightBarButtonItem.enabled = YES; }
2.推送
if (isAfterIOS8) { [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; [[UIApplication sharedApplication] registerForRemoteNotifications]; } else { [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)]; }
标签:
原文地址:http://www.cnblogs.com/liaods/p/4844715.html