(素材のソースコード)猫学IOS(21)UAppplication設定プログラムのアイコンの右上に赤い数字があります.れんが器などを指す


猫は分かち合って、逸品が必要です.
素材コードの住所:http://download.csdn.net/detail/u013357243/8602889 オリジナルの文章、転載を歓迎します.転載は明記してください:翟乃玉のブログの住所:http://blog.csdn.net/u013357243?view mode=contensts
効果
(素材源码)猫猫学IOS(二十一)UIApplication设置程序图标右上⾓红⾊数字_联⺴指⽰器等_第1张图片
(素材源码)猫猫学IOS(二十一)UIApplication设置程序图标右上⾓红⾊数字_联⺴指⽰器等_第2张图片
ソースコード
//
// NJViewController.m
// 06-UIApplication
//
// Created by apple on 14-6-3.
// Copyright (c) 2014  heima. All rights reserved.
//

#import "NJViewController.h"

@interface NJViewController ()

@end

@implementation NJViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

// UIApplication *app = [UIApplication sharedApplication];
// UIApplication *app1 = [UIApplication sharedApplication];
//// UIApplication *app2 = [[UIApplication alloc] init];
// NSLog(@"%p - %p ", app, app1);


    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
    [btn setTitle:@"   " forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(onClick) forControlEvents:UIControlEventTouchUpInside];
    btn.backgroundColor = [UIColor redColor];
    [self.view addSubview:btn];
}

- (void)onClick
{
// NSLog(@"   ");
    UIApplication *app = [UIApplication sharedApplication];
    //             
// app.applicationIconBadgeNumber = 998;
    //           
// app.networkActivityIndicatorVisible = YES;

    //         
    // app.statusBarStyle = UIStatusBarStyleLightContent;
// [app setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];

    //          
// app.statusBarHidden = YES;
// [app setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];

    /* URL:        ,             URL:    ://    /         :http://www.baidu.com/images/20140603/abc.png     :file:///users/apple/desktop/abc.png */

    NSURL *url = [NSURL URLWithString:@"http://www.baidu.com"];
    [app openURL:url];
}

//- (UIStatusBarStyle)preferredStatusBarStyle
//{
// return UIStatusBarStyleLightContent;
//}

//- (BOOL)prefersStatusBarHidden
//{
// return YES;
//}
@end
ps:iOS交流学習群を新設する:304570962猫QQ:174541256またはWeChat znycatを追加して、一緒に勉強しましょう.翟乃玉のブログアドレス:http://blog.csdn.net/u013357243?view mode=contensts