{"id":787,"date":"2016-10-12T12:12:04","date_gmt":"2016-10-12T04:12:04","guid":{"rendered":"http:\/\/www.yusian.com\/blog\/?p=787"},"modified":"2016-10-12T12:12:04","modified_gmt":"2016-10-12T04:12:04","slug":"%e5%a6%82%e4%bd%95%e8%8e%b7%e5%8f%96%e5%bd%93%e5%89%8d%e5%90%af%e5%8a%a8%e5%9b%belaunchimage%e7%9a%84%e5%9b%be%e7%89%87%e6%96%87%e4%bb%b6%e5%90%8d","status":"publish","type":"post","link":"https:\/\/www.yusian.com\/blog\/project\/2016\/10\/12\/121204787.html","title":{"rendered":"\u5982\u4f55\u83b7\u53d6\u5f53\u524d\u542f\u52a8\u56fe(LaunchImage)\u7684\u56fe\u7247\u6587\u4ef6\u540d"},"content":{"rendered":"<p>1\u3001\u901a\u8fc7\u83b7\u53d6\u5168\u5c40info.plist\u4e2d\u7684UILaunchImages\u5c5e\u6027\uff0c\u8fd9\u662f\u4e00\u4e2a\u5b57\u5178\uff0c\u5927\u6982\u683c\u5f0f\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre lang=\"objc\" line=\"1\"><__NSArrayM 0x6000002413b0>(\n{\n    UILaunchImageMinimumOSVersion = \"8.0\";\n    UILaunchImageName = \"LaunchImage-800-Portrait-736h\";\n    UILaunchImageOrientation = Portrait;\n    UILaunchImageSize = \"{414, 736}\";\n},\n{\n    UILaunchImageMinimumOSVersion = \"8.0\";\n    UILaunchImageName = \"LaunchImage-800-667h\";\n    UILaunchImageOrientation = Portrait;\n    UILaunchImageSize = \"{375, 667}\";\n},\n{\n    UILaunchImageMinimumOSVersion = \"7.0\";\n    UILaunchImageName = \"LaunchImage-700\";\n    UILaunchImageOrientation = Portrait;\n    UILaunchImageSize = \"{320, 480}\";\n},\n{\n    UILaunchImageMinimumOSVersion = \"7.0\";\n    UILaunchImageName = \"LaunchImage-700-568h\";\n    UILaunchImageOrientation = Portrait;\n    UILaunchImageSize = \"{320, 568}\";\n}\n)<\/pre>\n<p>2\u3001\u904d\u5386\u8fd9\u4e2a\u6570\u7ec4\uff0c\u627e\u5230\u56fe\u7247\u5c3a\u5bf8\u4e3a\u5f53\u524d\u5c4f\u5e55\u5c3a\u5bf8\u7684\u5b57\u5178\uff0c\u53d6\u51fa\u6587\u4ef6\u540d\u5373\u53ef<br \/>\n3\u3001\u5c01\u88c5\u6210\u5de5\u5177\u7c7b\u65b9\u6cd5<!--more--><\/p>\n<pre lang=\"objc\" line=\"1\">+ (NSString *)getLaunchImageName\n{\n    \/\/ \u53d6\u5f53\u524d\u5c4f\u5e55\u5c3a\u5bf8\n    CGSize viewSize =SAApp.delegate.window.bounds.size;\n    \n    NSString *launchImage = nil;\n    NSArray *imagesDict = [[SAMainBundle infoDictionary] valueForKey:@\"UILaunchImages\"];\n    for(NSDictionary *dict in imagesDict) {\n        \/\/ \u904d\u5386\u5404\u5b57\u5178\u4e2d\u5c3a\u5bf8\u5927\u5c0f\u53ca\u56fe\u50cf\u65b9\u5411\uff0c\u627e\u5230\u6211\u4eec\u9700\u8981\u7684\u90a3\u5f20\u56fe\n        CGSize imageSize = CGSizeFromString([dict objForKey:@\"UILaunchImageSize\"]);\n        NSString *orientation = [dict objForKey:@\"UILaunchImageOrientation\"];\n        \n        if (CGSizeEqualToSize(imageSize, viewSize) && [orientation isEqualToString:@\"Portrait\"]) {\n            launchImage = [dict objForKey:@\"UILaunchImageName\"];\n        }\n    }\n    return launchImage;\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u901a\u8fc7\u83b7\u53d6\u5168\u5c40info.plist\u4e2d\u7684UILaunchImages\u5c5e\u6027\uff0c\u8fd9\u662f\u4e00\u4e2a\u5b57\u5178\uff0c\u5927\u6982\u683c\u5f0f\u5982\u4e0b\u6240\u793a\uff1a ( { UILaunchImageMinimumOSVersion = &#8220;8.0&#8221;; UILaunchImageName = &#8220;LaunchImage-800-Portrait-736h&#8221;; UILaunchImageOrientation = Portrait; UILaunchImageSize = &#8220;{414, 736}&#8221;; }, { UILaunchImageMinimumOSVersion = &#8220;8.0&#8221;; UILaunchImageName = &#8220;LaunchImage-800-667h&#8221;; UILaunchImageOrientation = Portrait; UILaunchImageSize = &#8220;{375, 667}&#8221;; }, { UILaunchImageMinimumOSVersion = &#8220;7.0&#8221;; UILaunchImageName = &#8220;LaunchImage-700&#8221;; UILaunchImageOrientation = Portrait; UILaunchImageSize = &#8220;{320, 480}&#8221;; }, { UILaunchImageMinimumOSVersion = &#8220;7.0&#8221;; UILaunchImageName = &#8220;LaunchImage-700-568h&#8221;; UILaunchImageOrientation [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[20,17],"class_list":["post-787","post","type-post","status-publish","format-standard","hentry","category-project","tag-basics","tag-skill"],"_links":{"self":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/787","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/comments?post=787"}],"version-history":[{"count":0,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/787\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/media?parent=787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/categories?post=787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/tags?post=787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}