{"id":564,"date":"2018-02-23T23:40:04","date_gmt":"2018-02-23T15:40:04","guid":{"rendered":"http:\/\/60.205.208.74\/2018\/02\/23\/ios%e7%8a%b6%e6%80%81%e6%a0%8f\/"},"modified":"2018-02-23T23:40:04","modified_gmt":"2018-02-23T15:40:04","slug":"ios%e7%8a%b6%e6%80%81%e6%a0%8f","status":"publish","type":"post","link":"https:\/\/www.puzi7.net\/?p=564","title":{"rendered":"iOS\u72b6\u6001\u680f"},"content":{"rendered":"<span itemprop=\"description\"><div class=\"article-body\">\n<div class=\"article-intro\" id=\"content\">\n<h2>\u72b6\u6001\u680f\u7684\u4f7f\u7528<\/h2>\n<p>\u72b6\u6001\u680f\u663e\u793a\u8bbe\u5907\u7684\u5173\u952e\u4fe1\u606f\u3002<\/p>\n<ul>\n<li>\u8bbe\u5907\u6a21\u578b\u6216\u7f51\u7edc\u63d0\u4f9b\u5546<\/li>\n<li>\u7f51\u7edc\u4fe1\u53f7\u5f3a\u5ea6<\/li>\n<li>\u7535\u6c60\u4f7f\u7528\u91cf<\/li>\n<li>\u65f6\u95f4<\/li>\n<\/ul>\n<p>\u72b6\u6001\u680f\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p><img decoding=\"async\" alt=\"iOS Tutorial\" src=\"http:\/\/www.tutorialspoint.com\/ios\/images\/statusBar.jpg\"><\/p>\n<p>\u9690\u85cf\u72b6\u6001\u680f\u7684\u65b9\u6cd5<\/p>\n<pre> [[UIApplication sharedApplication] setStatusBarHidden:YES];<\/pre>\n<p><\/p>\n<hr>\n<h2>\u53e6\u4e00\u79cd\u9690\u85cf\u72b6\u6001\u680f\u7684\u65b9\u6cd5<span style=\"font-size: 1.5em;\"><br \/>\n<\/span><\/h2>\n<p>\u6211\u4eec\u8fd8\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0\u884c\uff0c\u5e76\u5728info.plist\u00a0\u7684\u5e2e\u52a9\u4e0b\u9009\u62e9\u00a0UIStatusBarHidden\u00a0\u9690\u85cf\u72b6\u6001\u680f\uff0c\u5e76\u4f7f\u5176\u503c\u4e3a\u5426\uff08NO\uff09\u3002<\/p>\n<h2>\u5728\u7c7b\u4e2d\u6dfb\u52a0\u81ea\u5b9a\u4e49\u65b9\u6cd5\u00a0hideStatusbar<\/h2>\n<p>\u5b83\u9690\u85cf\u72b6\u6001\u680f\u8fdb\u884c\u52a8\u753b\u5904\u7406\uff0c\u5e76\u4e5f\u8c03\u6574\u6211\u4eec\u8ba4\u4e3a\u5360\u636e\u72b6\u6001\u680f\u7a7a\u95f4\u7684\u5927\u5c0f\u3002<\/p>\n<pre> \n-(void)hideStatusbar{\n    [[UIApplication sharedApplication] setStatusBarHidden:YES \n    withAnimation:UIStatusBarAnimationFade];\n    [UIView beginAnimations:@\"Statusbar hide\" context:nil];\n    [UIView setAnimationDuration:0.5];\n    [self.view setFrame:CGRectMake(0, 0, 320, 480)];\n    [UIView commitAnimations];\n}<\/pre>\n<p>\u5728\u00a0ViewController.m\u00a0\u4e2d\u66f4\u65b0\u00a0viewDidLoad\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre> \n- (void)viewDidLoad\n{\n    [super viewDidLoad];\n    \/\/ The method hideStatusbar called after 2 seconds\n    [self performSelector:@selector(hideStatusbar) \n    withObject:nil afterDelay:2.0];\n    \/\/ Do any additional setup after loading the view, typically from a nib.\n}<\/pre>\n<p><\/p>\n<hr>\n<h2>\u521d\u59cb\u8f93\u51fa\u4ee5\u53ca2\u79d2\u540e\u8f93\u51fa<\/h2>\n<p><img decoding=\"async\" alt=\"iOS Tutorial\" src=\"http:\/\/www.tutorialspoint.com\/ios\/images\/statusBarOutput.jpg\" data-pinit=\"registered\"><\/p>\n<\/p><\/div>\n<\/p><\/div>\n<span>","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\"><span itemprop=\"description\">\u72b6\u6001\u680f\u7684\u4f7f\u7528 \u72b6\u6001\u680f\u663e\u793a\u8bbe\u5907\u7684\u5173\u952e\u4fe1\u606f\u3002 \u8bbe\u5907\u6a21\u578b\u6216\u7f51\u7edc\u63d0\u4f9b\u5546 \u7f51\u7edc\u4fe1\u53f7\u5f3a\u5ea6 \u7535\u6c60\u4f7f\u7528\u91cf &hellip;<\/span><\/p>\n<p class=\"more-link-p btn-align-right\"><a class=\"green zoom-btn\" href=\"https:\/\/www.puzi7.net\/?p=564\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,26],"tags":[74,93],"class_list":["post-564","post","type-post","status-publish","format-standard","hentry","category-ios","category-mobile","tag-ios","tag-mobile","zoom-theme-has-thumb"],"_links":{"self":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=564"}],"version-history":[{"count":0,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/564\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}