HTML5   发布时间:2022-04-27  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ios8/sdk8/xcode6/iphone6(+)适配大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

ios8/sdk8/xcode6/iphone6(+)适配AppIcon@H_607_8@@H_607_8@@H_607_8@

https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW1@H_607_8@

Table 39-1Size (in pixels) of custom icons and images

Asset@H_607_8@

iPhone 6 Plus (@3X)@H_607_8@

iPhone 6 and iPhone 5 (@2X)@H_607_8@

iPhone 4s (@2X)@H_607_8@

iPad and iPad mini (@2X)@H_607_8@

iPad 2 and iPad mini (@1X)@H_607_8@

App icon (required for all apps)@H_607_8@

180 x 180

120 x 120

152 x 152

76 x 76

App icon for the App Store (required for all apps)

1024 x 1024

1024 x 1024

Launch file or image (required for all apps)

Use a launch file (seeLaunch Images)

For iPhone 6,use a launch file (see Launch Images)

For iPhone 5,640 x 1136@H_607_8@

640 x 960

1536 x 2048 (porTrait)

2048 x 1536 (landscapE)@H_607_8@

768 x 1024 (porTrait)

1024 x 768 (landscapE)@H_607_8@

Spotlight search results icon (recommended)

80 x 80

40 x 40

SetTings icon (recommended)

87 x 87

58 x 58

29 x 29

Toolbar and navigation bar icon (optional)

About 66 x 66

About 44 x 44

About 22 x 22

Tab bar icon (optional)

About 75 x 75 (maximum: 144 x 96)

About 50 x 50 (maximum: 96 x 64)

About 25 x 25 (maximum: 48 x 32)

Default Newsstand cover icon for the App Store (required for Newsstand apps)

at least 1024 pixels on the longest edge

at least 512 pixels on the longest edge

Web clip icon (recommended for web apps and websites)

76 x 76

 @H_607_8@

 @H_607_8@

iphone6/6+ 更新:@H_607_8@

Icon-small@3x.png     87*87@H_607_8@

Icon-40@3x.png           120*120@H_607_8@

Icon-60@3x.png           180*180@H_607_8@

Icon.png                        57*57@H_607_8@

Icon@2x.png                114*114@H_607_8@

Icon-small.png                29*29@H_607_8@

Icon-small@2x.png            58*58@H_607_8@

Icon-small-50.png            50*50@H_607_8@

Icon-small-50@2x.png        100*100@H_607_8@

Icon-72.png                    72*72@H_607_8@

Icon-72@2x.png                144*144@H_607_8@

Icon-40.png                    40*40@H_607_8@

Icon-40@2x.png                80*80@H_607_8@

Icon-60.png                    60*60@H_607_8@

Icon-60@2x.png                120*120@H_607_8@

Icon-76.png                    76*76@H_607_8@

Icon-76@2x.png                152*152@H_607_8@

 @H_607_8@

 

ios8/sdk8/xcode6/iphone6(+)适配LaunchImage@H_607_8@@H_607_8@@H_607_8@

 https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LaunchImages.html#//apple_ref/doc/uid/TP40006556-CH22-SW1@H_607_8@

For iPhone 6@H_607_8@

750 x 1334 (@2X) for porTrait@H_607_8@

1334 x 750 (@2X) for landscape@H_607_8@

For iPhone 6 Plus:@H_607_8@

1242 x 2208 (@3X) for porTrait@H_607_8@

2208 x 1242 (@3X) for landscape@H_607_8@

---------------------------------------------------------------------@H_607_8@

 @H_607_8@

4.0 inch screen:@H_607_8@

Default-568h@2x.png (old 640x1136 ~ for iPhone 5)@H_607_8@

4.0 inch screen: @H_607_8@

LaunchImage-700-568h@2x.png (new 640x1136 ~ for iPhone 5)@H_607_8@

 @H_607_8@

4.7 inch screen: @H_607_8@

LaunchImage-800-667h@2x.png (750x1334 ~ for iPhone 6)@H_607_8@

 @H_607_8@

5.5 inch screen: @H_607_8@

LaunchImage-800-PorTrait-736h@3x.png (1242x2208 ~ for iPhone 6 Plus PorTrait)@H_607_8@

5.5 inch screen: @H_607_8@

LaunchImage-800-Landscape-736h@3x.png (2208x1242 ~ for iPhone 6 Plus LandscapE)@H_607_8@

 @H_607_8@

ReTina iPad:@H_607_8@

Default-PorTrait@2x~ipad.png (1536x2048 ~ for ReTina  iPad PorTrait)@H_607_8@

ReTina iPad:@H_607_8@

Default-Landscape@2x~ipad.png (2048x1536 ~ for ReTina  iPad LandscapE)@H_607_8@

iPad Mini/iPad:@H_607_8@

Default-PorTrait~ipad.png (768x1024 ~ for  iPad PorTrait)@H_607_8@

iPad Mini/iPad:@H_607_8@

Default-Landscape~ipad.png (1024x768 ~ for  iPad LandscapE)@H_607_8@

 @H_607_8@

ios8/sdk8/xcode6/iphone6(+)适配适配iphone6/6+启动界面@H_607_8@@H_607_8@@H_607_8@

 @H_607_8@

如果旧的工程直接跑到这两个模拟器中时,认是"兼容模式",即系统会简单的把内容等比例放大,显示效果有些模糊但尚可接受。此时App内部@L_197_12@到的设备分辨率和iPhone5是一样的:320*568 point。@H_607_8@

 @H_607_8@

启用高分辨率模式有2个方法:@H_607_8@

1.添加大屏的LaunchImage:@H_607_8@

在Images.xCassets里,删除旧的LaunchImage组,然后新建LaunchImage组,添加对应高分辨率的图片。(参http://matthewpalmer.net/blog/2014/09/10/iphone-6-plus-launch-image-adaptive-mode/)@H_607_8@


ios8/sdk8/xcode6/iphone6(+)适配
@H_607_8@@H_607_8@  @H_607_8@

2.添加Launch Screen File@H_607_8@

Launch Screen是Xcode6和iOS8新加的功能,它用一个xib文件来作为启动画面。App在旧版iOS(低于ios8)启动时,该属性会被自动忽略,不会造成异常。@H_607_8@

首先,点击New File ->iOS User Interface ->Launch Screen,然后在工程设置项里启用它:@H_607_8@

LaunchFile@H_607_8@


ios8/sdk8/xcode6/iphone6(+)适配
@H_607_8@@H_607_8@  不过这个xib不能关联任何的代码(不能自定义view的Class,不能IBOutlet,不能加Object),可以理解成这个xib就是一张截图,这个方案的好处在于可以使用到Size Classes来针对不同屏幕布局这个xib。@H_607_8@

 @H_607_8@

上面两处设置,只要启用任意一个即可让App进入高分辨率模式;但如果两处都没有设置,则App会回退到兼容模式。@H_607_8@

 @H_607_8@

PS:iPhone4、iPhone5、iPhone6这几个设备的ppi都是相同的,图片优先是@2x。iPhone6 Plus的像素密度更高,图片优先是@3x。 另外,iPhone6 Plus有一点和其他设备不同:在App内部获得的屏幕分辨率是1242*2208,但设备实际分辨率是1920*1080,这时系统会把整体的显示内容一个缩放,downscale到1/1.15。@H_607_8@

 

ios8/sdk8/xcode6/iphone6(+)适配
@H_607_8@@H_607_8@  @H_607_8@

 @H_607_8@

 @H_607_8@

ios8/sdk8/xcode6/iphone6(+)适配 UIPageControl的autoresizingMask@H_607_8@@H_607_8@@H_607_8@

 @H_607_8@

在设置UIPageControl实例的宽度时,显示的好像总是设置的四倍左右,但是把其他组建(UILable等)设置在同一父容器显示的是正常的。头文件看到UIPageControl的autoresizingMask认值是UIViewAutoresizingNone,但是感觉没起作用,于是这是下@H_607_8@

Java代码  

ios8/sdk8/xcode6/iphone6(+)适配@H_607_8@

  1. _mainPageControl.autoresizingMask = UIViewAutoresizingNone;  

 UIPageControl显示正确了。(apple的bug?)@H_607_8@

 @H_607_8@

ios8/sdk8/xcode6/iphone6(+)适配UIActivityViewController crashing on iPads by sdk8@H_607_8@@H_607_8@@H_607_8@

其老早在 https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActivityViewController_Class/ 中就说了:On iPad,you must present the view controller in a popover. On iPhone and iPod touch,you must present it modally。@H_607_8@

在sdk8之前你ipad还是用了presentViewController,那在dismissviewControllerAnimated的时候屏幕会旋转下,可能你还能接受,但是在sdk8便会直接crash,报错:@H_607_8@

 @H_607_8@

2014-10-15 14:03:25.927 BT2014[5133:488272*** TerminaTing app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController (<_UIAlertControllerActionSheetRegularPresentationController: 0x145578890>) should have a non-nil sourceView or barButtonItem set before the presentation oc@R_674_10930@.'  
  • *** First throw call stack:  
  • (0x187d9e084 0x1986900e4 0x18cc56bf0 0x18c81e3f8 0x18c81cf30 0x18c5a2efc 0x18c5149c0 0x187d56388 0x187d53314 0x187d536f4 0x187c81664 0x190d7f5a4 0x18c5864f8 0x1000c574c 0x198cfea08)  
  • libc++abi.dylib: terminaTing with uncaught exception of type NSException  
  •  所以用sdk8编译时ipad用pop,并且用新类: UIPopoverPresentationController

     @H_607_8@

     @H_607_8@

    ios8/sdk8/xcode6/iphone6(+)适配UIActivityViewController@H_607_8@@H_607_8@@H_607_8@

    Accessing the Completion Handler  
  • completionHandler  
  •  (iOS 8.0)  
  • The completion handler to execute after the activity view controller is dismissed.  
  •   
  • Declaration  
  • OBjeCTIVE-C  
  • @property(nonatomic, copy) UIActivityViewControllerCompletionHandler completionHandler  
  • Discussion  
  • When the user-SELEcted service finishes operating on the data, or when the user dismisses the view controller, the view controller executes this completion handler to let your app kNow the final result of the operation.  
  • Import Statement  
  • Availability  
  • Available in iOS 6.0 and later.  
  • Deprecated in iOS 8.0.  
  •  @H_607_8@

    ios8/sdk8/xcode6/iphone6(+)适配"Launchservices: invalidationHandler called" with UIActivityViewController iOS8@H_607_8@@H_607_8@@H_607_8@

    In iOS8 when I present or dismiss a UIActivityViewController,my app logs: "Launchservices: invalidationHandler called"。@H_607_8@

    https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIPopoverPresentationController_class/index.html@H_607_8@

    https://devforums.apple.com/@R_772_8798@ge/1049415#1049415@H_607_8@

    http://stackoverflow.com/questions/25192313/sharing-via-uiactivityviewcontroller-to-twitter-facebook-etc-causing-crash@H_607_8@

    可能是苹果的issue@H_607_8@

     @H_607_8@

    ios8/sdk8/xcode6/iphone6(+)适配ios sdk8/ios8 remoteNotification @H_607_8@@H_607_8@@H_607_8@

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@H_607_8@

    在苹果UIApplication文件中说明:@H_607_8@

    @interface UIApplication (UIRemoteNotifications)@H_607_8@

    .@H_607_8@

    .@H_607_8@

    .@H_607_8@

     @H_607_8@

    - (void)registerForRemoteNotificationTypes:(UIRemoteNotificationTypE)types NS_DEPRECATED_IOS(3_0,8_0, "Please use registerForRemoteNotifications and registerUserNotificationSetTings: instead");@H_607_8@

     @H_607_8@

    // Returns the enabled types,also taking into account any systemwide setTings; doesn't relate to connectivity.@H_607_8@

    - (UIRemoteNotificationTypE)enabledRemoteNotificationTypes NS_DEPRECATED_IOS(3_0, "Please use -[UIApplication isRegisteredForRemoteNotifications],or -[UIApplication currentUserNotificationSetTings] to retrieve user-enabled remote notification and user notification setTings");@H_607_8@

     @H_607_8@

     @H_607_8@

    @end@H_607_8@

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////@H_607_8@

     @H_607_8@

    所以在ios8中应该用的新的注册通知代码:@H_607_8@

    C代码  

    ios8/sdk8/xcode6/iphone6(+)适配@H_607_8@

      // IOS8 新的注册api  
    1.  if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)  
    2.  {  
    3.      [[UIApplication sharedApplication] registerUserNotificationSetTings:[UIUserNotificationSetTings  
    4.                                                                           setTingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadgE)  
    5.                                                                           categories:nil]];  
    6.        
    7.      [[UIApplication sharedApplication] registerForRemoteNotifications];  
    8.  }  
    9. else  
    10.      //原来注册通知代码  
    11.      [[UIApplication sharedApplication] registerForRemoteNotificationTypes:  
    12.       (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];  
    13.  }  

     原本在IOS7当中 判断push是否打开的方法是:@H_607_8@

    UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];  
  • return (types & UIRemoteNotificationTypeAlert);  
  •  @H_607_8@

    如果将这段代码使用在 IOS8当中,然不会出现crash的现象,但永远返回空。 在IOS8中,我们使用如下的新代码来取代以上的代码:@H_607_8@

    +(BOOL)enabledRemoteNotification{  
  •     UIRemoteNotificationType types;  
  •     if ([[[UIDevice currentDevice] systemVersion] floatValue] >=      {  
  •         types = [[UIApplication sharedApplication] currentUserNotificationSetTings].types;  
  •     }  
  •         types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];  
  •       
  • return (types & UIRemoteNotificationTypeAlert);  
  • }  
  •  @H_607_8@

    ios8/sdk8/xcode6/iphone6(+)适配ios 8 - buttons in horizontal scroll view intercepTing pan event - scroll does not work@H_607_8@@H_607_8@@H_607_8@

     含有uibutton的ScrollView在iOS8中无法滚动的解决办法:@H_607_8@

    theScrollView.panGestureRecognizer.delaysTouchesBegan = theScrollView.delaysContentTouches  

    大佬总结

    以上是大佬教程为你收集整理的ios8/sdk8/xcode6/iphone6(+)适配全部内容,希望文章能够帮你解决ios8/sdk8/xcode6/iphone6(+)适配所遇到的程序开发问题。

    如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

    本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
    如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。