(素材源碼)貓貓學IOS(二十一)UIApplication設定程式表徵圖右上⾓紅⾊數字_聯⺴指⽰器等,iosuiapplication

來源:互聯網
上載者:User

(素材源碼)貓貓學IOS(二十一)UIApplication設定程式表徵圖右上⾓紅⾊數字_聯⺴指⽰器等,iosuiapplication

貓貓分享,必須精品

素材代碼地址:http://download.csdn.net/detail/u013357243/8602889
原創文章,歡迎轉載。轉載請註明:翟乃玉的部落格
地址:http://blog.csdn.net/u013357243?viewmode=contents

效果

原始碼
////  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:1764541256 或則znycat 讓我們一起努力學習吧。
翟乃玉的部落格
地址:http://blog.csdn.net/u013357243?viewmode=contents

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.