IOS uiapplication Use

Source: Internet
Author: User

- (void) viewdidload{[Super Viewdidload]; //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 ( -, -, -, -)]; [BTN Settitle:@"dot me."Forstate:uicontrolstatenormal];    [Btn addtarget:self Action: @selector (OnClick) forcontrolevents:uicontroleventtouchupinside]; Btn.backgroundcolor=[Uicolor Redcolor]; [Self.view addsubview:btn];}- (void) onclick{//NSLog (@ "been ordered");UIApplication *app =[UIApplication sharedapplication]; //set the number on the application icon//app.applicationiconbadgenumber = 998; //set up a networking animation for the status bar//app.networkactivityindicatorvisible = YES; //set the style of the status bar//app.statusbarstyle = uistatusbarstylelightcontent;//[app Setstatusbarstyle:uistatusbarstylelightcontent Animated:yes]; //set whether the status bar is hidden//App.statusbarhidden = YES;//[app Setstatusbarhidden:yes Withanimation:uistatusbaranimationfade];        /*URL: Uniform Resource Locator, which is used to uniquely represent a resource URL: protocol header://Host address/resource Path network resource:Http://www.baidu.com/images/20140603/abc.pngLocal resources: File:///users/apple/desktop/abc.png*/Nsurl*url = [Nsurl urlwithstring:@"http://ios.itcast.cn"]; [App Openurl:url];}//-(Uistatusbarstyle) Preferredstatusbarstyle//{//return uistatusbarstylelightcontent;//}//-(BOOL) Prefersstatusbarhidden//{//return YES;//}

IOS uiapplication Use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.